Shader Blending Question

Scroll to bottom for quick version!

I know nothing about shaders so sorry if some of this doesn’t make sense.

The BlendedSky shader lets you blend between 2 skyboxes. I changed it to have 4, for night, dawn, day and dusk.

In the SubShader section in a Pass{} thing there are lines of code that combine the original 2 textures for the transition

SetTexture [_FrontTex] { combine texture }
SetTexture [_FrontTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
SetTexture [_FrontTex2] { combine previous +- primary, previous * primary }

I know nothing, so I just repeated that replacing the names _FrontTex and the numbers to the
ones I added in myself. It obviously does not work.

 _Blend ("Blend", Range(0.0,1.0)) = 0.5

That is at the beginning of the code, and I believe it is the slider.
Does this need to be modified in any way? It is included in the SetTexture things

How would I go about having it gradually blend from the first to second to the third and finally the last one? I already have code written to control the blending process in-game, so I don’t need any help there.

Quick Version

Is it possible to blend between 4 textures in a shader? If so, how?

in perfomance reason it’s better use blending between 2 textures

  • so attach tex1 to slot1 and tex2 to slot2, then blend from 0 to 1
  • then attach tex3 to slot1 and blend from 1 to 0
  • then attach tex4 to slot2 and blend from 0 to 1 again
  • etc

i believe that you needn’t blending between more then 2 textures at once?

anyway, you can try to make such blending

if you still really need all-in-one shader, i can write one for you. but do you really need it? 8)