Blending normals with a factor

Started by
-1 comments, last by Tijmen van den Heuvel 8 years, 2 months ago

I'm working on a splatmap like system to apply cetain textures over our characters, so far the diffuse and specular are working great. The vertex color is used to define how much of the blood ( R) or burn (G) texture to use, i simply lerp them with the original diffuse/spec.

However i'm a bit lost at how to blend the normals together properly. I've read this article, and i'm able to implement it but i cant figure out how to apply the factor.

The original looks like this:


float3 t = tex2D(texBase,   uv).xyz*float3( 2,  2, 2) + float3(-1, -1,  0);
float3 u = tex2D(texDetail, uv).xyz*float3(-2, -2, 2) + float3( 1,  1, -1);
float3 r = t*dot(t, u)/t.z - u;
return r*0.5 + 0.5;

I was thinking of adding my offset to the DOT, and maybe multiplying the `u` to reduce it as well.

Any tips are greatly appreciated!

This topic is closed to new replies.

Advertisement