Fixed Function Shader

1基本公式:

SetTexture [TexturePropertyName] { Texture Block }
All the src properties can be either one of previous, constant, primary or texture.
Previous is the the result of the previous SetTexture
官方的解释 初学者看了很萌。本文主要证明Previous的值。
首先举例:
1。SubShader {
                       Pass {
                          // Apply base texture
                        SetTexture [_MainTex] {
                              combine texture
                        }
                    // Blend in the alpha texture using the lerp operator
                      SetTexture [_BlendTex] {
                                combine texture lerp (texture) previous
                     }
               }
           }
以上shander代码中 previous很好理解 就是前一个SetTexture  combine完的结果
2、
SetTexture [_MainTex] {
    constantColor (1,1,1,1)
    combine constant lerp(texture) previous
}
// Multiply in texture
SetTexture [_MainTex] {
    combine previous * texture
}
第一个previous 该如何理解呢?它之前没有SetTexture喽!
于事 本人就开始了大胆的各种猜想,假设previous 默认值为(0,0,0,0)
测试1、没有灯 没有material的前提下
测试2、   贴的是一张全透图片  alpha值为0 最终颜色为previous颜色 
所以目前不是很确认previous的默认值为(0,0,0,0) 因为在有material和light on的时候 情况有变化  所以有待高手继续讨论 探究
posted @ 2013-03-20 16:11  U_探索  阅读(401)  评论(0编辑  收藏  举报