summaryrefslogtreecommitdiffhomepage
path: root/examples/web/models/resources/shaders/glsl100/skybox.vs
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-12-24 13:26:30 +0100
committerraysan5 <[email protected]>2020-12-24 13:26:30 +0100
commit83ab2cb01746a869b625c9d84fbb4737146b73a9 (patch)
tree010b0794848d863916e5acb4f766ea9e7ecb6e90 /examples/web/models/resources/shaders/glsl100/skybox.vs
parentd11274dcfcb0f349fba16ab4b83d2b96bcac8d1a (diff)
downloadraylib.com-83ab2cb01746a869b625c9d84fbb4737146b73a9.tar.gz
raylib.com-83ab2cb01746a869b625c9d84fbb4737146b73a9.zip
Updated Web examples to raylib 3.5
Diffstat (limited to 'examples/web/models/resources/shaders/glsl100/skybox.vs')
-rw-r--r--examples/web/models/resources/shaders/glsl100/skybox.vs24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/web/models/resources/shaders/glsl100/skybox.vs b/examples/web/models/resources/shaders/glsl100/skybox.vs
new file mode 100644
index 0000000..0d00d54
--- /dev/null
+++ b/examples/web/models/resources/shaders/glsl100/skybox.vs
@@ -0,0 +1,24 @@
+#version 100
+
+// Input vertex attributes
+attribute vec3 vertexPosition;
+
+// Input uniform values
+uniform mat4 projection;
+uniform mat4 view;
+
+// Output vertex attributes (to fragment shader)
+varying vec3 fragPosition;
+
+void main()
+{
+ // Calculate fragment position based on model transformations
+ fragPosition = vertexPosition;
+
+ // Remove translation from the view matrix
+ mat4 rotView = mat4(mat3(view));
+ vec4 clipPos = projection*rotView*vec4(vertexPosition, 1.0);
+
+ // Calculate final vertex position
+ gl_Position = clipPos.xyzw;
+}