Solid.vsh 728 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #version 100
  2. /* Attributes */
  3. attribute vec3 inVertexPosition;
  4. attribute vec3 inVertexNormal;
  5. attribute vec4 inVertexColor;
  6. attribute vec2 inTexCoord0;
  7. /* Uniforms */
  8. uniform mat4 uWVPMatrix;
  9. uniform mat4 uWVMatrix;
  10. uniform mat4 uTMatrix0;
  11. uniform float uThickness;
  12. /* Varyings */
  13. varying vec2 vTextureCoord0;
  14. varying vec4 vVertexColor;
  15. varying float vFogCoord;
  16. void main()
  17. {
  18. gl_Position = uWVPMatrix * vec4(inVertexPosition, 1.0);
  19. gl_PointSize = uThickness;
  20. vec4 TextureCoord0 = vec4(inTexCoord0.x, inTexCoord0.y, 1.0, 1.0);
  21. vTextureCoord0 = vec4(uTMatrix0 * TextureCoord0).xy;
  22. vVertexColor = inVertexColor.bgra;
  23. vec3 Position = (uWVMatrix * vec4(inVertexPosition, 1.0)).xyz;
  24. vFogCoord = length(Position);
  25. }