• Advertisement
Sign in to follow this  

object space normals and skinning?

This topic is 1324 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

Hi,

 

I have red at multiple web spots that one cannot use object space normal map on a skined mesh.

Why , since one would not transform vertrex smooth normal and tangent, but the texture sampled normal instead?

What would be wrong with that?

Share this post


Link to post
Share on other sites
Advertisement

Was there any reasoning written why they can't be used together? Object space normal maps can't be tiled at least (in typical cases). 

 

Cheers!

Edited by kauna

Share this post


Link to post
Share on other sites

Was there any reasoning written why they can't be used together? Object space normal maps can't be tiled at least. 

 

Cheers!

Actualy there was no reasoning for that. I know about the tilling restriction (or any other remaping).I am not aware of other restrictions though

Share this post


Link to post
Share on other sites

Otherwise, why not use tangent space normal mapping? It is pretty standard.

Share this post


Link to post
Share on other sites

I'm using object space normal maps with skinned meshes and at least I think it works just fine. 

 

I pass an object space light vector to the vertex shader. This is then more precisely in the object bind pose space. Then I transform that by the transposes of the bone matrices (which transform from bind pose to skin pose) in the vertex shader and pass that to fragment shader, where a dot product is calculated with the object space normal sampled from a texture.

 

To see how this works mathematically, say that n is object space (bind pose) normal and L is light vector in the object space (also bind pose). Let S be a bone matrix for one bone that transforms from bind pose to skin pose. We want to evaluate dot(Sn,L). This is just dot(Sn,L) = dot(n,S^T L). This is done for all bone matrices that affect the vertex in question and a weighted sum is calculated.

Share this post


Link to post
Share on other sites

Otherwise, why not use tangent space normal mapping? It is pretty standard.

Becouse of the interpolation gradient effect on triangle edges.

Indeed, interpolated normals on edges create a value that is not donated to by third itnerpolator, creating seems that can get visible.

 

jmakitalo, big thanks for your input!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement