mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-06 19:38:15 +00:00
Renamed shader variable
This commit is contained in:
@@ -122,7 +122,7 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness)
|
|||||||
mat.shader.locs[LOC_MAP_BRDF] = GetShaderLocation(mat.shader, "brdfLUT");
|
mat.shader.locs[LOC_MAP_BRDF] = GetShaderLocation(mat.shader, "brdfLUT");
|
||||||
|
|
||||||
// Set view matrix location
|
// 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_MATRIX_VIEW] = GetShaderLocation(mat.shader, "view");
|
||||||
mat.shader.locs[LOC_VECTOR_VIEW] = GetShaderLocation(mat.shader, "viewPos");
|
mat.shader.locs[LOC_VECTOR_VIEW] = GetShaderLocation(mat.shader, "viewPos");
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@ in vec4 vertexTangent;
|
|||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
uniform mat4 mvp;
|
uniform mat4 mvp;
|
||||||
uniform mat4 mMatrix;
|
uniform mat4 matModel;
|
||||||
|
|
||||||
// Output vertex attributes (to fragment shader)
|
// Output vertex attributes (to fragment shader)
|
||||||
out vec3 fragPosition;
|
out vec3 fragPosition;
|
||||||
@@ -31,10 +31,10 @@ void main()
|
|||||||
vec3 vertexBinormal = cross(vertexNormal, vec3(vertexTangent));
|
vec3 vertexBinormal = cross(vertexNormal, vec3(vertexTangent));
|
||||||
|
|
||||||
// Calculate fragment normal based on normal transformations
|
// 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
|
// 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
|
// Send vertex attributes to fragment shader
|
||||||
fragTexCoord = vertexTexCoord;
|
fragTexCoord = vertexTexCoord;
|
||||||
|
Reference in New Issue
Block a user