• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            腳踏實(shí)地

            心 勿噪

            please please please, make it smaller!

            http://www.iquilezles.org/blog/?p=2828

            I think size matters. However, unlike in real life, when programming the smaller the better. Generally. Also, the less branches the better, at least when programming for parallel systems. And also, the more compact and regular, the prettier (but this is my personal opinion only).
            Related to this, in the last 6 months I have pointed out / proposed this same optimization to at least five different people. Basically, it seems most people make this same “mistake” over and over again, which is to write this horrifying thing
            vec3 color = vec3(0.0);
            if (theta < 1.0) {
            color.r = 1.0;
            color.g = theta;
            }
            else if (theta < 2.0) {
            color.r = 2.0 - theta;
            color.g = 1.0;
            }
            else if (theta < 3.0) {
            color.g = 1.0;
            color.b = theta - 2.0;
            }
            else if (theta < 4.0) {
            color.g = 4.0 - theta;
            color.b = 1.0;
            }
            else if (theta < 5.0) {
            color.r = theta - 4.0;
            color.b = 1.0;
            }
            else {
            color.r = 1.0;
            color.b = 6.0 - theta;
            }
            return color;
            instead of this equivalent line:
            vec3 color = clamp( abs(mod(theta+vec3(0.,4.,2.),6.)-3.)-1., 0., 1. );

            posted on 2015-01-05 14:22 LSH 閱讀(304) 評(píng)論(0)  編輯 收藏 引用


            只有注冊用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            99久久国语露脸精品国产| 人人狠狠综合久久亚洲婷婷| 九九久久精品国产| 久久本道综合久久伊人| 无码国内精品久久人妻麻豆按摩| 国产精品久久久久免费a∨| 久久久久无码精品国产不卡| 国产高潮久久免费观看| 少妇人妻综合久久中文字幕| 成人国内精品久久久久一区| 国产精自产拍久久久久久蜜| 伊人久久大香线蕉av一区| 久久青青草原综合伊人| 国内精品伊人久久久久妇| 国产91久久精品一区二区| 久久精品人妻中文系列| 91麻豆精品国产91久久久久久 | 久久精品国产亚洲AV电影| 94久久国产乱子伦精品免费 | 亚洲AV无码久久精品狠狠爱浪潮| 九九99精品久久久久久| 人人妻久久人人澡人人爽人人精品| 久久精品国产免费一区| 亚洲乱码中文字幕久久孕妇黑人| 91麻精品国产91久久久久 | 天天躁日日躁狠狠久久| 久久久无码精品午夜| 国产精品美女久久久免费| 国内精品久久久久影院一蜜桃| 亚洲美日韩Av中文字幕无码久久久妻妇| 2021久久国自产拍精品| 精品一二三区久久aaa片| 久久精品极品盛宴观看| 亚洲国产精品嫩草影院久久| 久久综合伊人77777| 精品国产综合区久久久久久 | 久久综合给合久久狠狠狠97色| 91麻豆国产精品91久久久| 久久综合久久综合亚洲| 久久午夜无码鲁丝片秋霞| 久久精品国产亚洲AV香蕉|