Sign in to follow this  

Blending normals with a factor

This topic is 666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Edited by info@tjheuvel.net

Share this post


Link to post
Share on other sites

This topic is 666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this