mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Vertex shaders optimization
This commit is contained in:
@ -6,8 +6,7 @@ in vec2 vertexTexCoord;
|
||||
in vec3 vertexNormal;
|
||||
|
||||
// Projection and model data
|
||||
uniform mat4 projectionMatrix;
|
||||
uniform mat4 modelviewMatrix;
|
||||
uniform mat4 mvpMatrix;
|
||||
uniform mat4 modelMatrix;
|
||||
|
||||
// Attributes to fragment shader
|
||||
@ -21,8 +20,8 @@ void main()
|
||||
|
||||
// Calculate view vector normal from model
|
||||
mat3 normalMatrix = transpose(inverse(mat3(modelMatrix)));
|
||||
fragNormal = normalize(normalMatrix * vertexNormal);
|
||||
fragNormal = normalize(normalMatrix*vertexNormal);
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = projectionMatrix * modelviewMatrix * vec4(vertexPosition, 1.0);
|
||||
gl_Position = mvpMatrix*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user