PDA

View Full Version : shader code



wookash
06-11-2011, 03:25 PM
I'm not sure how to add an x and y offsets to the mask code. Could someone please help me..

uniform sampler2D imageTex;
uniform sampler2D maskTex;
void main (void) {
vec4 c1 = texture2D(imageTex, gl_TexCoord[0].st);
vec4 c2 = texture2D(maskTex, gl_TexCoord[0].st);
gl_FragColor = c1 * c2;
}

przemo_li
06-12-2011, 02:13 AM
What x and y offsets? Define them.

Do not tell what they are but simply define them in your shader code.