I’m sure this has been asked before, so if someone can point me in the right direction, I’d appreciate it. Here’s the issue I’m seeing… This is a bit long winded, but I don’t have any pics to share at the moment, so trying to explain the issue.
I have a model, imported from Blender. It’s a simple hightmap displaced plane intended for use as a landscape. Because I don’t want to paint the landscape by hand, I’ve worked out a simple procedural tritexture shader that uses world coordinates and world normal to determine which texture to use and the UV for each. This worked fine. I added normal mapping, which wasn’t hard but has inconsistent results.
“flat” pixels (i.e. those with a tangent-space normal of 0,0,1) work great. So a normal map with rgb=0.5,0.5,1.0 works correctly.
The issue is that y axis normal displacements on the normal map appear to be backwards, but ONLY on surfaces that are closer to worldNormal vertical (note that the projection is vertical in this case). Pixels with the same (all be it distorted) projection closer to worldNormal horizontal have the correct normal displacement. At first, I thought that the projection just needed to be flipped in the Y, but then the results are also flipped. FWIW, the x axis displacement is correct.
I’m wondering if there’s an issue with the bitangent direction that might be causing the y directed normals to flip once the pixel’s worldNormal reaches a certain point, but can’t tell. Is there a known issue? I’ve tried different combinations of letting Blender export the tangent, having Unity calculate it, in both blend and FBX files - pretty much the same result.
Questions… any thoughts on what might be happening (the UV must be calculated procedurally, so I can’t remap it in Blender)? And, in a surface shader, is there any way to get to currently used bitangent vector, so I can check that value and/or change the tangent space coordinate system on a pixel by pixel bases to use for the normal displacement?
