Guest User

Untitled

a guest
Jan 17th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.65 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <shader>
  3.     <vertex>
  4.         #version 330
  5.  
  6.         uniform mat4 projMatrix;
  7.         uniform mat4 worldMatrix;
  8.  
  9.         in vec3 vertex;
  10.         in vec2 vertexUv;
  11.        
  12.         // Output data ; will be interpolated for each fragment.
  13.         out vec2 uv;
  14.  
  15.         void main(void) {
  16.             vec4 v = vec4(vertex, 1);
  17.             gl_Position = projMatrix * worldMatrix * v;
  18.             uv = vertexUv;
  19.         }
  20.     </vertex>
  21.     <fragment>
  22.         #version 330
  23.  
  24.         // Interpolated values from the vertex shaders
  25.         in vec2 uv;
  26.         uniform sampler2D texture;
  27.        
  28.         // Ouput data
  29.         out vec3 color;
  30.  
  31.         void main(void) {
  32.             color = texture2D(texture, uv).rgb;
  33.             //color = vec3(1, 0, 0);
  34.         }
  35.     </fragment>
  36. </shader>
Add Comment
Please, Sign In to add comment