gdkchan / SPICA

Experimental H3D tool
The Unlicense
95 stars 46 forks source link

Tangent is wrong in fragment shader #2

Closed freedom12 closed 7 years ago

freedom12 commented 7 years ago

rtx Sorry,my English is poor I think the value of tangent is not right in fragment shader

gdkchan commented 7 years ago

Hmm... Are you sure it is wrong? I don't think that tangents are supposed to be smooth like normals are (I already tested bump mapping where tangents was not smooth and it looked correct). The problem I believe is that Pokémon seems to use object space normal mapping (which doesn't need Normal and Tagent in the first place). The type of normal map kind of depends on what the vertex shader feeds to the gpu, the output being just a quaternion representing the normal rotation(?), so my current theory is that the normal map type is vertex shader-dependent and pokemon uses object space. Through it would be weird that the model includes Normal and Tangent when they are not needed. hmm...