Guest User

Height based custom material - vertex shader.

a guest
May 19th, 2013
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uniform float m_tilingFactor;
  2. uniform mat4 g_WorldViewProjectionMatrix;
  3. uniform mat4 g_WorldMatrix;
  4. uniform mat3 g_NormalMatrix;
  5. uniform vec4 g_LightDirection;
  6. uniform vec4 g_LightPosition;
  7.  
  8. uniform float m_terrainSize;
  9.  
  10. attribute vec4 inTexCoord;
  11. attribute vec3 inNormal;
  12. attribute vec3 inPosition;
  13.  
  14. varying vec3 normal;
  15. varying vec4 position;
  16.  
  17. void main()
  18. {
  19.     normal = normalize(inNormal);
  20.     position = g_WorldMatrix * vec4(inPosition, 0.0);
  21.         gl_Position = g_WorldViewProjectionMatrix * vec4(inPosition, 1);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment