|
|
Textures and Masking
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);
|
|
0
|
|
|
|
Reply
|
Latti
|
1/15/2006 9:15:18 PM |
|
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);
>
>
|
|
0
|
|
|
|
Reply
|
Maik
|
1/15/2006 9:34:41 PM
|
|
|
1 Replies
220 Views
(page loaded in 0.034 seconds)
Similiar Articles: Textures and alpha masking - comp.graphics.api.openglHi all, I'm trying to render a quad using multipass rendering in order to apply two different textures on it. The first texture is a normal 1024x102... What is the fastest bitmap/texture to texture copy with stencil ...What is the fastest bitmap/texture to texture copy with stencil/Mask? What is the fastest bitmap/texture to texture copy with stencil/Mask? - Graphics . Render to depth texture - comp.graphics.api.openglTextures and alpha masking - comp.graphics.api.opengl You can't erase the stuff you once render with a texture containing alpha. ... must be 0) 0, // No layer mask ... alpha blending of lines on polygons with depth - comp.graphics.api ...Textures and alpha masking - comp.graphics.api.opengl... object with alpha texture disappears at horizon line - Unity ... function, the polygon alpha will ... what is ... Blending in OpenGL - comp.graphics.api.openglTextures and alpha masking - comp.graphics.api.opengl Alpha blending with depth buffer - comp.graphics.api.opengl ... Textures and alpha masking - comp.graphics.api.opengl ... Image blending - comp.graphics.api.openglTextures and alpha masking - comp.graphics.api.opengl Image blending - comp.graphics.api.opengl... blending info into texture 1 and image A into texture 2 and draw a quad ... what is depth buffer? - comp.graphics.api.openglstill struggling with FBOs and depth texture (for shadow map ... Looking for ... Textures and alpha masking - comp.graphics.api.opengl what is depth buffer? - comp.graphics.api ... still struggling with FBOs and depth texture (for shadow map ...Textures and alpha masking - comp.graphics.api.opengl... glEnable(GL.GL_BLEND); glDisable(GL.GL_DEPTH_TEST ... GL_ARB_texture_env_dot3 GL_ARB_transpose_matrix GL_SGIS ... Alpha blending with depth buffer - comp.graphics.api.opengl ...Textures and alpha masking - comp.graphics.api.opengl what is depth buffer? - comp.graphics.api.opengl Alpha blending with depth buffer - comp.graphics.api.opengl ... glpolygonoffset problem - comp.graphics.api.openglTextures and alpha masking - comp.graphics.api.opengl glpolygonoffset problem - comp.graphics.api.opengl... 0, 0, // Don't care about them 0, 0, // No alpha buffer ... Final Cut Pro Texture and Masking - YouTubeA short lesson on using texture and image mask techniques in Final Cut Pro. Sony Vegas Pro 8, 10 Tutorial: Masking, Motion Masking, and TexturesPlease Read Important Info You May Want To Know!!! Hi welcome to another Tutorial for Sony Vegas Pro 8 and Sony Vegas Pro 10. Both functions and buttons ... 7/21/2012 8:36:37 AM
|
|
|
|
|
|
|
|
|