• <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 閱讀(303) 評論(0)  編輯 收藏 引用


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


            人人狠狠综合久久亚洲高清| 无码人妻久久一区二区三区蜜桃| 亚洲综合久久夜AV | 无码任你躁久久久久久老妇| 性做久久久久久久久| 无码精品久久久久久人妻中字| 久久99精品久久久久久hb无码| 88久久精品无码一区二区毛片 | 国产成人精品久久亚洲| 日韩AV毛片精品久久久| 国内精品伊人久久久久妇| 久久国产乱子精品免费女| 一本大道久久东京热无码AV | 久久久久国产一级毛片高清板| 精品国产乱码久久久久久人妻| 99久久免费国产精品| 人妻无码精品久久亚瑟影视 | 精品久久久久久久| 亚洲国产精品无码久久SM| 久久se精品一区二区影院| 久久综合丝袜日本网| 久久99精品久久只有精品| 亚洲天堂久久久| 蜜臀av性久久久久蜜臀aⅴ麻豆 | 欧美熟妇另类久久久久久不卡| 精品久久久久久无码国产| 久久精品国产亚洲av水果派| 东京热TOKYO综合久久精品 | 色欲久久久天天天综合网| 久久久久99精品成人片| 日本三级久久网| 久久91综合国产91久久精品| 国产成人精品三上悠亚久久| 欧美色综合久久久久久| 久久国产午夜精品一区二区三区| 久久99精品国产自在现线小黄鸭 | 99re久久精品国产首页2020| 精品久久久久久久久免费影院| 国产精品热久久无码av| 国产精品免费久久久久影院| 国内精品久久久久久久亚洲|