[ad_1]
I might wish to consult with this query as a result of I did not fully reply to my downside.
I’ve carried out regular and parallax mapping however due to some assumptions I’ve to make use of two completely different TBN matrices for every impact.
One of the vital necessary assumptions is that I’ve deferred renderer with normals encoding and light-weight calculations in view area.
This means that I’ve to transform information from regular maps (that are in tangent area) to view area utilizing beneath TBN matrix:
mat3 NormalMatrix = transpose(inverse(mat3(ModelViewMatrix)));
vec3 T = normalize(NormalMatrix * Tangent);
vec3 N = normalize(NormalMatrix * Regular);
vec3 B = normalize(NormalMatrix * Bitangent);
mat3 TBN = mat3(T, B, N);
Alternatively parallax mapping required view course vector in tangent area. To compute that I exploit digital camera place and fragment place (in world area) multiplied by following TBN matrix to maneuver this vectors from world area to tangent area:
T = normalize(mat3(ModelMatrix) * Tangent);
N = normalize(mat3(ModelMatrix) * Regular);
B = normalize(mat3(ModelMatrix) * Bitangent);
mat3 TBN = transpose(mat3(T, B, N));
I am in search of a strategy to optimize that. Is it potential to make it higher?
[ad_2]