summaryrefslogtreecommitdiffhomepage
path: root/examples/shaders/shaders_mesh_instancing.data
diff options
context:
space:
mode:
authorRay <[email protected]>2021-10-22 23:08:14 +0200
committerRay <[email protected]>2021-10-22 23:08:14 +0200
commit0eb62adfcc1643e77c0fa43128d09b22d0574017 (patch)
tree8ac012a1f5ea641511f04fe2af47d173c58023d4 /examples/shaders/shaders_mesh_instancing.data
parent3f64f53cf9f24413ef61052c15302bf1fcc50e0c (diff)
downloadraylib.com-0eb62adfcc1643e77c0fa43128d09b22d0574017.tar.gz
raylib.com-0eb62adfcc1643e77c0fa43128d09b22d0574017.zip
update
Diffstat (limited to 'examples/shaders/shaders_mesh_instancing.data')
-rw-r--r--examples/shaders/shaders_mesh_instancing.data72
1 files changed, 36 insertions, 36 deletions
diff --git a/examples/shaders/shaders_mesh_instancing.data b/examples/shaders/shaders_mesh_instancing.data
index 441e858..c3b9d71 100644
--- a/examples/shaders/shaders_mesh_instancing.data
+++ b/examples/shaders/shaders_mesh_instancing.data
@@ -1,5 +1,41 @@
#version 100
+// Input vertex attributes
+attribute vec3 vertexPosition;
+attribute vec2 vertexTexCoord;
+attribute vec3 vertexNormal;
+attribute vec4 vertexColor;
+
+attribute mat4 instanceTransform;
+
+// Input uniform values
+uniform mat4 mvp;
+uniform mat4 matNormal;
+
+// Output vertex attributes (to fragment shader)
+varying vec3 fragPosition;
+varying vec2 fragTexCoord;
+varying vec4 fragColor;
+varying vec3 fragNormal;
+
+// NOTE: Add here your custom variables
+
+void main()
+{
+ // Compute MVP for current instance
+ mat4 mvpi = mvp*instanceTransform;
+
+ // Send vertex attributes to fragment shader
+ fragPosition = vec3(mvpi*vec4(vertexPosition, 1.0));
+ fragTexCoord = vertexTexCoord;
+ fragColor = vertexColor;
+ fragNormal = normalize(vec3(matNormal*vec4(vertexNormal, 1.0)));
+
+ // Calculate final vertex position
+ gl_Position = mvpi*vec4(vertexPosition, 1.0);
+}
+#version 100
+
precision mediump float;
// Input vertex attributes (from vertex shader)
@@ -79,39 +115,3 @@ void main()
// Gamma correction
gl_FragColor = pow(finalColor, vec4(1.0/2.2));
}
-#version 100
-
-// Input vertex attributes
-attribute vec3 vertexPosition;
-attribute vec2 vertexTexCoord;
-attribute vec3 vertexNormal;
-attribute vec4 vertexColor;
-
-attribute mat4 instanceTransform;
-
-// Input uniform values
-uniform mat4 mvp;
-uniform mat4 matNormal;
-
-// Output vertex attributes (to fragment shader)
-varying vec3 fragPosition;
-varying vec2 fragTexCoord;
-varying vec4 fragColor;
-varying vec3 fragNormal;
-
-// NOTE: Add here your custom variables
-
-void main()
-{
- // Compute MVP for current instance
- mat4 mvpi = mvp*instanceTransform;
-
- // Send vertex attributes to fragment shader
- fragPosition = vec3(mvpi*vec4(vertexPosition, 1.0));
- fragTexCoord = vertexTexCoord;
- fragColor = vertexColor;
- fragNormal = normalize(vec3(matNormal*vec4(vertexNormal, 1.0)));
-
- // Calculate final vertex position
- gl_Position = mvpi*vec4(vertexPosition, 1.0);
-}