Guest User

Untitled

a guest
Jan 27th, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. /////////////////////////////////////////////////////////////////////////
  2. // Pixel shader for the final pass
  3. //
  4. // Copyright 2013 DigiPen Institute of Technology
  5. ////////////////////////////////////////////////////////////////////////
  6. #version 330
  7.  
  8.  
  9. uniform vec3 phongDiffuse;
  10. uniform bool useTexture;
  11. uniform sampler2D groundColor;
  12.  
  13. in vec3 normalVec;
  14. in vec4 pos;
  15.  
  16. out vec4 f_vertexPos;
  17. out vec4 f_vertexNormal;
  18. out vec4 f_vertexDiffuse;
  19.  
  20. in vec2 texCoord;
  21.  
  22. void main()
  23. {
  24.     vec3 Kd = phongDiffuse;
  25.     if (useTexture)
  26.     {
  27.         Kd = texture(groundColor,2.0*texCoord.st).xyz;
  28.     }
  29.  
  30.  
  31.     f_vertexPos.xyz = pos.xyz;
  32.     f_vertexPos.w = 1.0f;
  33.  
  34.     f_vertexNormal.xyz = normalVec;
  35.     f_vertexNormal.w = 1.0f;
  36.  
  37.     f_vertexDiffuse.xyz = Kd;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment