Re: Textures and Masking



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);



.



Relevant Pages

  • Re: multitexturing and combiners problems
    ... but I think that GL_DECAL does not work with lit ... Now I will disable blending. ... the most basic multitexturing effect (a texture on another texture), ... I cannot get that effect with combiners nor without. ...
    (comp.graphics.api.opengl)
  • Re: Texture blending.... Some pls give me a clue!
    ... What kind of "blend" do you want to do? ... the texture blending. ... These are alpha testing render states and don't affect alpha blending, ... either in the frame buffer or in the texture stage. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: alpha blending on floating point rendertarget
    ... Did anyone manage to get alpha blending working on these FP textures? ... Depending on the geometry to render, ... Start having the data to be the DST of a blening operation in a texture ... methods to split scenes with higher depth complexity. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • billboard sorting
    ... I' like to sort them by camera distance, ... texture and blending params. ... So i have to give more priority texture than distance in my ...
    (comp.graphics.api.opengl)
  • Re: Problem with Texture Blending
    ... If you need different coordinates for each texture, then yes, this is the ... texture stage uses from the vertex format is specified by ... I have a mask, for example a black & white mask and ... contains a blending value. ...
    (microsoft.public.win32.programmer.directx.managed)