Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <shader>
- <vertex>
- #version 330
- uniform mat4 projMatrix;
- uniform mat4 worldMatrix;
- in vec3 vertex;
- in vec2 vertexUv;
- // Output data ; will be interpolated for each fragment.
- out vec2 uv;
- void main(void) {
- vec4 v = vec4(vertex, 1);
- gl_Position = projMatrix * worldMatrix * v;
- uv = vertexUv;
- }
- </vertex>
- <fragment>
- #version 330
- // Interpolated values from the vertex shaders
- in vec2 uv;
- uniform sampler2D texture;
- // Ouput data
- out vec3 color;
- void main(void) {
- color = texture2D(texture, uv).rgb;
- //color = vec3(1, 0, 0);
- }
- </fragment>
- </shader>
Add Comment
Please, Sign In to add comment