You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, this is a really lightweight and cool Triplanar solution, but unfortunately, since the o.Normal output is in tangent space, it still relies on tangents and bitangents being generated by Unity and will produce incorrect normals for every face whose normal isn't parallel to the projection plane. Unfortunately, i don't think there is any way of providing custom tangents and bitangents with surface shaders.
The text was updated successfully, but these errors were encountered:
@ls29322 Here is the problem: Surface shaders are designed so that a tangent space normal map is assigned inside the surface function, and transformed into world space using the TBN matrix. The TBN matrix uses the tangents and bitangents generated for a UV map, which don't match our projection. We want the tangents and bitangents to also be triplanar projected, otherwise we get wrong normals. You can see an example of what i mean here:
Swizzling the projection axis the way you're suggesting doesn't solve the problem, you just get bad normals for the other 3 sides instead. The way the problem looks is that "outwards" pointing features become "inwards" pointing on the opposite sides of the projection axes. There are also some other subtle errors.
So, this is a really lightweight and cool Triplanar solution, but unfortunately, since the o.Normal output is in tangent space, it still relies on tangents and bitangents being generated by Unity and will produce incorrect normals for every face whose normal isn't parallel to the projection plane. Unfortunately, i don't think there is any way of providing custom tangents and bitangents with surface shaders.
The text was updated successfully, but these errors were encountered: