Advertisement
entrusc

Lighting.vert

Mar 25th, 2015
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define ATTENUATION
  2. //#define HQ_ATTENUATION
  3.  
  4. uniform mat4 g_WorldViewProjectionMatrix;
  5. uniform mat4 g_WorldViewMatrix;
  6. uniform mat4 g_ProjectionMatrix;
  7. uniform mat3 g_NormalMatrix;
  8. uniform mat4 g_ViewMatrix;
  9. uniform mat4 g_WorldMatrix;
  10. uniform vec3 g_CameraPosition;
  11. uniform float g_Time;
  12.  
  13. varying vec3 texCoord;
  14. varying vec3 texCoord2;
  15.  
  16. varying vec3 vecPosition;
  17. varying vec3 vecPositionInWorld;
  18. varying vec3 vecNormal;
  19. varying float mipMapDepth;
  20.  
  21. attribute vec3 inPosition;
  22. attribute vec3 inTexCoord;
  23. attribute vec3 inTexCoord2;
  24. attribute vec3 inNormal;
  25.  
  26. #ifdef SHIFT
  27.     uniform vec3 m_ShiftVector;
  28.     uniform mat3 m_ShiftRotation;
  29. #endif
  30.  
  31. void main(){
  32.     vec4 pos = vec4(inPosition, 1.0);
  33.     gl_Position = g_WorldViewProjectionMatrix * pos;
  34.  
  35.     //position within sector  
  36.     vecPosition = inPosition;
  37.     #ifdef SHIFT
  38.         vecPosition = m_ShiftRotation * vecPosition;
  39.         vecPosition += m_ShiftVector;
  40.     #endif
  41.  
  42.     vecNormal = inNormal;
  43.     texCoord = inTexCoord;
  44.     texCoord2 = inTexCoord2;
  45.  
  46.     //position within the world
  47.     vecPositionInWorld = vec3(g_WorldMatrix * pos);
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement