Re: Textures and Masking
- From: Maik Wagner <maik-wagner@xxxxxx>
- Date: Sun, 15 Jan 2006 22:34:41 +0100
Hi,
I haven't checked your Blending so far. But one quite good method is simple multitexturing with the right Texture-Combine Mode. This is independent from what is in the frame buffer before, not like Blending.
Just google'ing a bit should help. (And on modern Graphic Cards at least 4 Texture Units are supported).
For Blending check your 2 images. Like in Nehe said: " It's also very important that your image has a BLACK background and the mask has a WHITE background!".
Maik Wagner
Latti wrote:
I have 2 textures and would like to use 1 texture (black-gray-white) as a Mask for the other (Color). I used the technique described in Lesson 20 of Nehe (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=20).
The result is not quite what I expected (http://users.pandora.be/bart.de.lathouwer/mask.gif).
I expected the color texture to be only partially visible (where the Mask color is black), in stead, the Mask texture shines through.
Any help anyone?
Thanks - Bart
glEnable(GL_BLEND); glDisable(GL_DEPTH_TEST);
glBlendFunc(GL_DST_COLOR,GL_ZERO); m_pMaskTexture->Draw(); // glBind and draw GL_QUADS
glBlendFunc(GL_ONE, GL_ONE); m_pFrame->Draw(); // glBind and draw GL_QUADS
glEnable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
.
- References:
- Textures and Masking
- From: Latti
- Textures and Masking
- Prev by Date: Textures and Masking
- Next by Date: is there analog of TEXTURE_RECTANGLE_NV for ati cards to skip scaling part ?
- Previous by thread: Textures and Masking
- Next by thread: is there analog of TEXTURE_RECTANGLE_NV for ati cards to skip scaling part ?
- Index(es):
Relevant Pages
|