Review formating

This commit is contained in:
Ray
2023-12-23 14:07:45 +01:00
parent 706f74bce0
commit e039a221a3
4 changed files with 92 additions and 90 deletions

View File

@ -25,17 +25,16 @@ const float normalOffset = 0.1;
void main()
{
// calc binormal from vertex normal and tangent
// Compute binormal from vertex normal and tangent
vec3 vertexBinormal = cross(vertexNormal, vertexTangent);
// calc fragment normal based on normal transformations
// Compute fragment normal based on normal transformations
mat3 normalMatrix = transpose(inverse(mat3(matModel)));
// calc fragment position based on model transformations
// Compute fragment position based on model transformations
fragPosition = vec3(matModel*vec4(vertexPosition, 1.0f));
fragTexCoord = vertexTexCoord*2.0;
fragNormal = normalize(normalMatrix*vertexNormal);
vec3 fragTangent = normalize(normalMatrix*vertexTangent);
fragTangent = normalize(fragTangent - dot(fragTangent, fragNormal)*fragNormal);
@ -45,5 +44,5 @@ void main()
TBN = transpose(mat3(fragTangent, fragBinormal, fragNormal));
// Calculate final vertex position
gl_Position = mvp * vec4(vertexPosition, 1.0);
gl_Position = mvp*vec4(vertexPosition, 1.0);
}