Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //http://www.youtube.com/user/thecplusplusguy
- //vertexshader, create a file for it as vertex.vs
- #version 120
- uniform vec3 color;
- varying vec3 color2; //out
- attribute vec3 atr; //in
- varying vec2 texcoord;
- void main()
- {
- gl_Position=gl_ModelViewProjectionMatrix*gl_Vertex;
- color2=atr;
- texcoord=gl_MultiTexCoord0.xy;
- }
- //fragment shader, create a file for it named fragment.frag
- #version 120
- uniform sampler2D img;
- uniform sampler2D img2;
- uniform vec3 color;
- varying vec3 color2; //in
- varying vec2 texcoord;
- void main()
- {
- vec4 texcolor=texture2D(img,texcoord);
- vec4 texcolor2=texture2D(img2,texcoord);
- gl_FragColor=texcolor2*0.5 + texcolor*0.5;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement