From 60350699c792b816b20704d59cfbda0894cdba39 Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Tue, 21 Jul 2015 23:56:41 +0200 Subject: Add wielded (and CAOs) shader --- client/shaders/wielded_shader/opengl_vertex.glsl | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 client/shaders/wielded_shader/opengl_vertex.glsl (limited to 'client/shaders/wielded_shader/opengl_vertex.glsl') 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; +} -- cgit v1.2.3