Creating a color mask with glsl

Started by
0 comments, last by SuperVGA 13 years, 12 months ago
Hi, I've been creating textures for a soccer field to make the dark stripes on the grass. But i'd like to do it without texture, just with a grey color mask. Here is my soccer field : http://img571.imageshack.us/img571/9097/captures.png What i'd like to do is to use a texture with the same stripes (with blue and red stripes). When my shaders would find a blue pixel it could apply the grey color. Is it clear enough ? Thanks for your help.
Advertisement
Would you like to blend a texture with underlying colours in the framebuffer?
Such as, multiplying this white and grey stiped texture with the soccer field?

You could just sample both textures with sampler2D,
and multiply each channel in the vec3 from both textures.
You could also do the lines and logos painted on the grass like this.

Edit: Just saw that the title of your post said "Mask". Naturally, you
can just have the GLSL program use the color from one texture if the mask
in that coordinate is blue, and the color from another texture if it's not.

This topic is closed to new replies.

Advertisement