mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-15 19:05:34 +00:00
WARNING: REVIEWED: Default shader uniform names
When a shader is loaded, by default, several locations are tried to be set automatically.
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
attribute vec3 vertexPosition;
|
||||
|
||||
// Input uniform values
|
||||
uniform mat4 projection;
|
||||
uniform mat4 view;
|
||||
uniform mat4 matProjection;
|
||||
uniform mat4 matView;
|
||||
|
||||
// Output vertex attributes (to fragment shader)
|
||||
varying vec3 fragPosition;
|
||||
@@ -16,5 +16,5 @@ void main()
|
||||
fragPosition = vertexPosition;
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = projection*view*vec4(vertexPosition, 1.0);
|
||||
gl_Position = matProjection*matView*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
attribute vec3 vertexPosition;
|
||||
|
||||
// Input uniform values
|
||||
uniform mat4 projection;
|
||||
uniform mat4 view;
|
||||
uniform mat4 matProjection;
|
||||
uniform mat4 matView;
|
||||
|
||||
// Output vertex attributes (to fragment shader)
|
||||
varying vec3 fragPosition;
|
||||
@@ -16,9 +16,9 @@ void main()
|
||||
fragPosition = vertexPosition;
|
||||
|
||||
// Remove translation from the view matrix
|
||||
mat4 rotView = mat4(mat3(view));
|
||||
vec4 clipPos = projection*rotView*vec4(vertexPosition, 1.0);
|
||||
mat4 rotView = mat4(mat3(matView));
|
||||
vec4 clipPos = matProjection*rotView*vec4(vertexPosition, 1.0);
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = clipPos.xyzw;
|
||||
gl_Position = clipPos;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
in vec3 vertexPosition;
|
||||
|
||||
// Input uniform values
|
||||
uniform mat4 projection;
|
||||
uniform mat4 view;
|
||||
uniform mat4 matProjection;
|
||||
uniform mat4 matView;
|
||||
|
||||
// Output vertex attributes (to fragment shader)
|
||||
out vec3 fragPosition;
|
||||
@@ -16,5 +16,5 @@ void main()
|
||||
fragPosition = vertexPosition;
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = projection*view*vec4(vertexPosition, 1.0);
|
||||
gl_Position = matProjection*matView*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
in vec3 vertexPosition;
|
||||
|
||||
// Input uniform values
|
||||
uniform mat4 projection;
|
||||
uniform mat4 view;
|
||||
uniform mat4 matProjection;
|
||||
uniform mat4 matView;
|
||||
|
||||
// Output vertex attributes (to fragment shader)
|
||||
out vec3 fragPosition;
|
||||
@@ -16,9 +16,9 @@ void main()
|
||||
fragPosition = vertexPosition;
|
||||
|
||||
// Remove translation from the view matrix
|
||||
mat4 rotView = mat4(mat3(view));
|
||||
vec4 clipPos = projection*rotView*vec4(vertexPosition, 1.0);
|
||||
mat4 rotView = mat4(mat3(matView));
|
||||
vec4 clipPos = matProjection*rotView*vec4(vertexPosition, 1.0);
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = clipPos.xyzw;
|
||||
gl_Position = clipPos;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user