Renamed modelviewprojection matrix
This commit is contained in:
parent
74fd671763
commit
0fc1323c80
@ -15,7 +15,7 @@ in vec3 vertexNormal;
|
|||||||
in vec3 vertexTangent;
|
in vec3 vertexTangent;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
uniform mat4 mvpMatrix;
|
uniform mat4 mvp;
|
||||||
uniform mat4 mMatrix;
|
uniform mat4 mMatrix;
|
||||||
|
|
||||||
// Output vertex attributes (to fragment shader)
|
// Output vertex attributes (to fragment shader)
|
||||||
@ -45,5 +45,5 @@ void main()
|
|||||||
fragBinormal = cross(fragNormal, fragTangent);
|
fragBinormal = cross(fragNormal, fragTangent);
|
||||||
|
|
||||||
// Calculate final vertex position
|
// Calculate final vertex position
|
||||||
gl_Position = mvpMatrix*vec4(vertexPosition, 1.0);
|
gl_Position = mvp*vec4(vertexPosition, 1.0);
|
||||||
}
|
}
|
@ -7,7 +7,7 @@ attribute vec3 vertexNormal;
|
|||||||
attribute vec4 vertexColor;
|
attribute vec4 vertexColor;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
uniform mat4 mvpMatrix;
|
uniform mat4 mvp;
|
||||||
|
|
||||||
// Output vertex attributes (to fragment shader)
|
// Output vertex attributes (to fragment shader)
|
||||||
varying vec2 fragTexCoord;
|
varying vec2 fragTexCoord;
|
||||||
@ -22,5 +22,5 @@ void main()
|
|||||||
fragColor = vertexColor;
|
fragColor = vertexColor;
|
||||||
|
|
||||||
// Calculate final vertex position
|
// Calculate final vertex position
|
||||||
gl_Position = mvpMatrix*vec4(vertexPosition, 1.0);
|
gl_Position = mvp*vec4(vertexPosition, 1.0);
|
||||||
}
|
}
|
@ -7,7 +7,7 @@ in vec3 vertexNormal;
|
|||||||
in vec4 vertexColor;
|
in vec4 vertexColor;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
uniform mat4 mvpMatrix;
|
uniform mat4 mvp;
|
||||||
|
|
||||||
// Output vertex attributes (to fragment shader)
|
// Output vertex attributes (to fragment shader)
|
||||||
out vec2 fragTexCoord;
|
out vec2 fragTexCoord;
|
||||||
@ -22,5 +22,5 @@ void main()
|
|||||||
fragColor = vertexColor;
|
fragColor = vertexColor;
|
||||||
|
|
||||||
// Calculate final vertex position
|
// Calculate final vertex position
|
||||||
gl_Position = mvpMatrix*vec4(vertexPosition, 1.0);
|
gl_Position = mvp*vec4(vertexPosition, 1.0);
|
||||||
}
|
}
|
@ -3251,12 +3251,12 @@ static Shader LoadShaderDefault(void)
|
|||||||
"out vec2 fragTexCoord; \n"
|
"out vec2 fragTexCoord; \n"
|
||||||
"out vec4 fragColor; \n"
|
"out vec4 fragColor; \n"
|
||||||
#endif
|
#endif
|
||||||
"uniform mat4 mvpMatrix; \n"
|
"uniform mat4 mvp; \n"
|
||||||
"void main() \n"
|
"void main() \n"
|
||||||
"{ \n"
|
"{ \n"
|
||||||
" fragTexCoord = vertexTexCoord; \n"
|
" fragTexCoord = vertexTexCoord; \n"
|
||||||
" fragColor = vertexColor; \n"
|
" fragColor = vertexColor; \n"
|
||||||
" gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n"
|
" gl_Position = mvp*vec4(vertexPosition, 1.0); \n"
|
||||||
"} \n";
|
"} \n";
|
||||||
|
|
||||||
// Fragment shader directly defined, no external file required
|
// Fragment shader directly defined, no external file required
|
||||||
@ -3302,7 +3302,7 @@ static Shader LoadShaderDefault(void)
|
|||||||
shader.locs[LOC_VERTEX_COLOR] = glGetAttribLocation(shader.id, "vertexColor");
|
shader.locs[LOC_VERTEX_COLOR] = glGetAttribLocation(shader.id, "vertexColor");
|
||||||
|
|
||||||
// Get handles to GLSL uniform locations
|
// Get handles to GLSL uniform locations
|
||||||
shader.locs[LOC_MATRIX_MVP] = glGetUniformLocation(shader.id, "mvpMatrix");
|
shader.locs[LOC_MATRIX_MVP] = glGetUniformLocation(shader.id, "mvp");
|
||||||
shader.locs[LOC_COLOR_DIFFUSE] = glGetUniformLocation(shader.id, "colDiffuse");
|
shader.locs[LOC_COLOR_DIFFUSE] = glGetUniformLocation(shader.id, "colDiffuse");
|
||||||
shader.locs[LOC_MAP_DIFFUSE] = glGetUniformLocation(shader.id, "texture0");
|
shader.locs[LOC_MAP_DIFFUSE] = glGetUniformLocation(shader.id, "texture0");
|
||||||
}
|
}
|
||||||
@ -3332,7 +3332,7 @@ static void SetShaderDefaultLocations(Shader *shader)
|
|||||||
shader->locs[LOC_VERTEX_COLOR] = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_COLOR_NAME);
|
shader->locs[LOC_VERTEX_COLOR] = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_COLOR_NAME);
|
||||||
|
|
||||||
// Get handles to GLSL uniform locations (vertex shader)
|
// Get handles to GLSL uniform locations (vertex shader)
|
||||||
shader->locs[LOC_MATRIX_MVP] = glGetUniformLocation(shader->id, "mvpMatrix");
|
shader->locs[LOC_MATRIX_MVP] = glGetUniformLocation(shader->id, "mvp");
|
||||||
shader->locs[LOC_MATRIX_PROJECTION] = glGetUniformLocation(shader->id, "projection");
|
shader->locs[LOC_MATRIX_PROJECTION] = glGetUniformLocation(shader->id, "projection");
|
||||||
shader->locs[LOC_MATRIX_VIEW] = glGetUniformLocation(shader->id, "view");
|
shader->locs[LOC_MATRIX_VIEW] = glGetUniformLocation(shader->id, "view");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user