Got bored, started to play with shaders in UE3 and this thing just kept on growing. Doesn't do anything that special..yet other than blending two set of textures together by using vertex color and a height map. And giving you a lot of options with just one shader.
It's a scalable shader, so as you turn the switches on and off . More options will show or disappear.
And since it's scalable, when you turn something off (StaticParameterSwitchesValues) it will not add up to the total shader instructions and it will drop the textures that it is not using. That way it does not add up to the total texture call.
I will clean it up a bit, add a few more things and reorder some of the switches later. If you find any bugs or want something extra let me know.
Some of the options...excuse the textures. Good enough for testing. ;D
This is with a lot of things turned on if you want to just use a diffuse, spec, normal. You can also do that and it will drop all the unnecessary instructions.
http://dl.dropbox.com/u/849247/SC_shadersV1.upkStaticParameterSwitchesValues.Use Color Specular? Drops the red channels of the MSG textures and uses a color specular texture instead.
Use Simple Gloss? Uses a simple constant to define the strenght of the glossiness. Drops the blue channels of the MSG textures.
Use Reflection? By default uses the result of the vertex and height map mask.
Use Base Reflection Mask (G)? Uses the green channel of the BaseMSG map for the reflection mask.
VectorParameterValues.Normal Strenght : Increases the strenght of the normal map. RGB values should be kept between 255,255,255 and 255,255,0
Specular Tint : Tints the specular of the red channel from the MSG textures.
Base MSG :
Green channel. Reflection mask
Red channel. Specular map
Blue channel. Gloss map
Overlay MSG :
Green channel. Height map (used for blending with vertex color)
Red channel. Specular map
Blue channel. Gloss map
Replies
Done, now the size of fresnel falloff can also be changed, ill update it later today with other things aswell
I really like how you are using channel textures too with the option to tint the spec, great way to save some texture memory.this looks like quite the ubershader dude, thanks for sharing.
New fresnel type, the falloff scale can now be changed and using the mask from the green channel (reflection mask) of the Base MSG texture the fresnel can be masked out. That mask can also be blended, so that fresnel will still show on the rest of the model even if the reflection mask is pure black and white.
Use Diffuse color simple? Tints the whole diffuse texture.
Use Diffuse color RGB? Uses an extra texture with all the channels used as masks to change the colors of the diffuse texture.
Removed Ambient Color shading, since this cannot work with the current method of texture blending. Its kind of pointless to have two different ways of shading the meshes, when it can't be used on everything.
Normal strenght doesn't work anymore if t fresnel is used. Still inside the material mainly for testing purposes.
http://dl.dropbox.com/u/849247/SC_shadersV2.upk
Is there anything about custom lighting on UDN?, didn't see anything about it there.