Renamed shader variable

This commit is contained in:
Ray 2018-05-06 00:44:59 +02:00
parent f14492432d
commit 04db494db0
2 changed files with 4 additions and 4 deletions

View File

@ -122,7 +122,7 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness)
mat.shader.locs[LOC_MAP_BRDF] = GetShaderLocation(mat.shader, "brdfLUT");
// Set view matrix location
mat.shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(mat.shader, "mMatrix");
mat.shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(mat.shader, "matModel");
mat.shader.locs[LOC_MATRIX_VIEW] = GetShaderLocation(mat.shader, "view");
mat.shader.locs[LOC_VECTOR_VIEW] = GetShaderLocation(mat.shader, "viewPos");

View File

@ -16,7 +16,7 @@ in vec4 vertexTangent;
// Input uniform values
uniform mat4 mvp;
uniform mat4 mMatrix;
uniform mat4 matModel;
// Output vertex attributes (to fragment shader)
out vec3 fragPosition;
@ -31,10 +31,10 @@ void main()
vec3 vertexBinormal = cross(vertexNormal, vec3(vertexTangent));
// Calculate fragment normal based on normal transformations
mat3 normalMatrix = transpose(inverse(mat3(mMatrix)));
mat3 normalMatrix = transpose(inverse(mat3(matModel)));
// Calculate fragment position based on model transformations
fragPosition = vec3(mMatrix*vec4(vertexPosition, 1.0f));
fragPosition = vec3(matModel*vec4(vertexPosition, 1.0f));
// Send vertex attributes to fragment shader
fragTexCoord = vertexTexCoord;