Formula for Palette?

When I’m trying to make a riverflow material, I used the Panner to mix two different Normal map, but there isn’t ways to adjust it in Material Instances made from the orignal material; then I realize how to disassemble the Panner palette to some simple formula, that is:

Panner=Original coordinate + Time * some Vector

Now, I want to know more about other palette, say Depth Fade / Fresnel / Sphere Mask. Can anyone answer me directly? Or is there some formula table to check?

You can get the exact math by checking the HLSL code in the material editor when adding a node.

For example, that’s it for Fresnel:


Sometimes there’s a function called which is defined in another shader file, just like ClampedPow in Common.usf.

So the Fresnel node is actually this:
[FONT=Courier New]pow(max(abs(1-max(0,dot(Normal,CameraVector))),0.000001f),ExponentIn)*(1-BaseReflectFractionIn)+BaseReflectFractionIn

Pretty complex but for a basic fresnel you’ll only need the dot product of Normal and CameraVector to the power of x.

Thank you very much!! Now I’d know how to make a lot of Instanced Materials.