Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #version 150
- #define GL_core_profile 1
- #extension GL_EXT_gpu_shader4 : enable
- #extension GL_ARB_shader_texture_lod : enable
- uniform mat4 Gpu_ModelViewMatrix; // Modelview
- uniform mat4 Gpu_ModelViewMatrixInverse; // Inverse of modelview
- uniform mat4 Gpu_ProjectionMatrix; // Projection
- uniform mat3 Gpu_NormalMatrix; // Normal matrix (IT of 3x3 rotation part of modelview)
- uniform vec3 lightPos; // Light position
- in vec3 Gpu_Vertex; // Vertices (attr 0)
- in vec3 Gpu_Normal; // Normals (attr 3)
- in vec4 Gpu_MultiTexCoord0; // TexCoords (attr 1 and 2)
- in vec4 Gpu_MultiTexCoord1;
- out vec3 vert_vout; // Vertices in view space
- out vec3 normal_vout; // Normals in view space
- out vec3 light_vout; // Light in view space
- out vec4 projCoord_vout; // Projection coordinates (projective texcoords between -1 - 1 from camera)
- void main()
- {
- vert_vout = vec3(Gpu_ModelViewMatrix * vec4(Gpu_Vertex, 1.0));
- light_vout = vec3(Gpu_ModelViewMatrixInverse * vec4(lightPos, 1.0));
- normal_vout = Gpu_NormalMatrix * Gpu_Normal;
- projCoord_vout = Gpu_ProjectionMatrix * Gpu_ModelViewMatrix * vec4(Gpu_Vertex, 1.0);
- gl_Position = projCoord_vout;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement