diff options
author | RealBadAngel <maciej.kasatkin@o2.pl> | 2015-07-21 23:56:41 +0200 |
---|---|---|
committer | RealBadAngel <maciej.kasatkin@o2.pl> | 2015-07-21 23:56:41 +0200 |
commit | 60350699c792b816b20704d59cfbda0894cdba39 (patch) | |
tree | 59e9a369d9ea87804035ee27ea902a81b4f90060 /client/shaders/wielded_shader/opengl_vertex.glsl | |
parent | 5b0c719171eb9ccb8f2829eb1cc8b3fe9f24cd05 (diff) | |
download | hax-minetest-server-60350699c792b816b20704d59cfbda0894cdba39.tar.gz hax-minetest-server-60350699c792b816b20704d59cfbda0894cdba39.zip |
Add wielded (and CAOs) shader
Diffstat (limited to 'client/shaders/wielded_shader/opengl_vertex.glsl')
-rw-r--r-- | client/shaders/wielded_shader/opengl_vertex.glsl | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/client/shaders/wielded_shader/opengl_vertex.glsl b/client/shaders/wielded_shader/opengl_vertex.glsl new file mode 100644 index 000000000..a2ab9fa5f --- /dev/null +++ b/client/shaders/wielded_shader/opengl_vertex.glsl @@ -0,0 +1,35 @@ +uniform mat4 mWorldViewProj;
+uniform mat4 mInvWorld;
+uniform mat4 mTransWorld;
+uniform mat4 mWorld;
+
+uniform float dayNightRatio;
+uniform vec3 eyePosition;
+uniform float animationTimer;
+
+varying vec3 vPosition;
+varying vec3 worldPosition;
+
+varying vec3 eyeVec;
+varying vec3 lightVec;
+varying vec3 tsEyeVec;
+varying vec3 tsLightVec;
+
+const float e = 2.718281828459;
+const float BS = 10.0;
+
+void main(void)
+{
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_Position = mWorldViewProj * gl_Vertex;
+
+ vPosition = gl_Position.xyz;
+ worldPosition = (mWorld * gl_Vertex).xyz;
+ + vec3 sunPosition = vec3 (0.0, eyePosition.y * BS + 900.0, 0.0);
+
+ lightVec = sunPosition - worldPosition;
+ eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz; +
+ gl_FrontColor = gl_BackColor = gl_Color;
+}
|