summaryrefslogtreecommitdiffhomepage
path: root/examples/models
diff options
context:
space:
mode:
authorRay <[email protected]>2018-05-06 00:44:59 +0200
committerRay <[email protected]>2018-05-06 00:44:59 +0200
commit04db494db0d8bd6b645c941a9920925531d6ad5e (patch)
treebe2b3adaec6d70a5717248fa3e69564d14712ed1 /examples/models
parentf14492432d590cef90cb747a2063f6998a61f108 (diff)
downloadraylib-04db494db0d8bd6b645c941a9920925531d6ad5e.tar.gz
raylib-04db494db0d8bd6b645c941a9920925531d6ad5e.zip
Renamed shader variable
Diffstat (limited to 'examples/models')
-rw-r--r--examples/models/models_material_pbr.c2
-rw-r--r--examples/models/resources/shaders/pbr.vs6
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/models/models_material_pbr.c b/examples/models/models_material_pbr.c
index 33f13e2c..d50ef3da 100644
--- a/examples/models/models_material_pbr.c
+++ b/examples/models/models_material_pbr.c
@@ -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");
diff --git a/examples/models/resources/shaders/pbr.vs b/examples/models/resources/shaders/pbr.vs
index 885cb199..8bd3faa1 100644
--- a/examples/models/resources/shaders/pbr.vs
+++ b/examples/models/resources/shaders/pbr.vs
@@ -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;