summaryrefslogtreecommitdiff
path: root/example/vertexshadowshader.glsl
diff options
context:
space:
mode:
authorknolax <1339802534.kk@gmail.com>2017-03-10 11:31:48 -0500
committerknolax <1339802534.kk@gmail.com>2017-03-10 11:31:48 -0500
commita8b8bf1d5e08f56d0f71536889b691335435adfe (patch)
tree1f91b891c8283b02c233df658ae96717f7ab6cd1 /example/vertexshadowshader.glsl
parent21f3329340ccd9a8c42335f84b34d3f7e4a2e99a (diff)
added magic code for second shader, prepared to be for shadow rendering, added roadmap
Diffstat (limited to 'example/vertexshadowshader.glsl')
-rw-r--r--example/vertexshadowshader.glsl19
1 files changed, 19 insertions, 0 deletions
diff --git a/example/vertexshadowshader.glsl b/example/vertexshadowshader.glsl
new file mode 100644
index 0000000..8ba8228
--- /dev/null
+++ b/example/vertexshadowshader.glsl
@@ -0,0 +1,19 @@
+#version 130
+uniform mat4 proj;
+uniform mat4 tran;
+uniform mat4 cam;
+uniform mat4 rot;
+in vec3 position;
+in vec3 vnormal;
+in vec3 texcoord;
+varying vec4 fragpos;
+varying vec4 fragnormal; // if this needs to not be blended jsut have all vertexes in a poly be the same
+varying vec2 fragtexcoord;
+void main()
+{
+ //this is the actual position
+ gl_Position = proj * cam * tran * vec4(position, 1.0f);// - vec4(gl_Normal, 1.0f);
+ fragpos = tran * vec4(position, 1.0f);
+ fragnormal = (tran * vec4(vnormal, 1.0f)) - (tran * vec4(0.0, 0.0, 0.0, 1.0));
+ fragtexcoord = texcoord.xy;
+}