summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRuminant <[email protected]>2021-06-24 17:48:48 +0100
committerGitHub <[email protected]>2021-06-24 18:48:48 +0200
commitf3eff740cece7481ca7d1631703c02a1029ff729 (patch)
treed0f8482d8bd06d026e3717401068285c5725f626
parentf4c171aa45543bf148b0b983eedd96ad08cd9553 (diff)
downloadraylib-f3eff740cece7481ca7d1631703c02a1029ff729.tar.gz
raylib-f3eff740cece7481ca7d1631703c02a1029ff729.zip
fix to LoadShaderFromMemory (#1851)
- the shader.locs now match the LoadShader function Without this change, the lighting sample looks incorrect when using LoadShaderFromMemory Co-authored-by: Ruminant <[email protected]>
-rw-r--r--src/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index 4a99aa32..2ec441ad 100644
--- a/src/core.c
+++ b/src/core.c
@@ -2414,8 +2414,9 @@ RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode)
// Get handles to GLSL uniform locations (vertex shader)
shader.locs[SHADER_LOC_MATRIX_MVP] = rlGetLocationUniform(shader.id, "mvp");
- shader.locs[SHADER_LOC_MATRIX_PROJECTION] = rlGetLocationUniform(shader.id, "projection");
shader.locs[SHADER_LOC_MATRIX_VIEW] = rlGetLocationUniform(shader.id, "view");
+ shader.locs[SHADER_LOC_MATRIX_PROJECTION] = rlGetLocationUniform(shader.id, "projection");
+ shader.locs[SHADER_LOC_MATRIX_NORMAL] = rlGetLocationUniform(shader.id, "matNormal");
// Get handles to GLSL uniform locations (fragment shader)
shader.locs[SHADER_LOC_COLOR_DIFFUSE] = rlGetLocationUniform(shader.id, "colDiffuse");