Hey guys,
Quick observations concerning texture combiners:
Maximum of 4 SetTextures?
Uncommenting a fifth block discards the fourth’s output (and shows aqua instead of red):
Shader "_Texture Combiners Test D" {
Properties {
}
SubShader {
Pass {
SetTexture [_] {
constantColor (1,0,0,0) // red
combine constant
}
SetTexture [_] {
constantColor (0,1,0,0) // green
combine previous
}
SetTexture [_] {
constantColor (0,0,1,0) // blue
combine previous
}
SetTexture [_] {
constantColor (1,1,0,0) // yellow
combine previous
}
/*
SetTexture [_] {
constantColor (0,1,1,0) // aqua
combine previous
}
*/
}
}
}
Maximum of 2 src operations?
Only the first two seem considered:
Shader "_Texture Combiners Test E" {
Properties {
_Color ("Src Tint", Color) = (1,1,1,1)
_Tex ("Src Texture", 2D) = ""
_MainTex ("Dst Texture", 2D) = ""
}
SubShader {
Pass {
SetTexture [_]
{
constantColor (1,0,0,0)
combine constant
}
SetTexture [_]
{
constantColor [_Color]
combine constant, previous alpha
}
SetTexture [_Tex]
{
constantColor [_Color]
combine constant Lerp(texture) previous
matrix [_Matrix]
}
SetTexture [_MainTex]
{
combine previous Lerp(previous) texture, one - previous alpha * texture alpha + previous alpha // works
//combine previous Lerp(previous) texture, texture alpha * one - previous alpha + previous alpha // works
//combine previous Lerp(previous) texture, previous alpha + texture alpha * one - previous alpha // does not work
}
}
}
}