triple settexture in alpha diffuse

Hi guys,

Ive been writing some shaders using the built in sources as a starting point. Looking through Alpha-Diffuse I found something odd in the PPL pass of the first subshader. After the cg snippet is closed three settexture’s are done:

SetTexture [_MainTex] {combine texture}
SetTexture [_LightTexture0] {combine texture}
SetTexture [_LightTextureB0] {combine texture}

As far as I know only the third could possibly have an effect as none use previous (is it at all possible to have a cg snippet and a settexture in one pass?). Also, commenting all three setTextures has no noticable effect in my scene.

Could someone enlighten me?

Thanks, Bas

I think that was leftover from Unity 1.x era. Now, when you have a fragment program (=pixel shader), SetTexture commands effectively have no effect. Back in Unity 1.x, you had to manually write the corresponding number of dummy SetTexture commands so that textures are bound correctly.