Multitexturing Project
i have been trying to get multitexturing to work with my program. im trying to draw a quad or any object for that matter and place texture or color onto it and then apply a transparency map. for example i want a particle system of bubbles, stars, or blood. i just want to draw a color and cut out the rest of the polygon with a mask. any ideas?
thanks ahead of time
-adam
[edited by - adam17 on February 6, 2004 1:05:25 AM]
Do you know how to accomplish that without multitexturing ? If so, (i don't know if this works, but if it doesn't i doupt if it's possible) enable the first texture channel, set the 'draw mask' blend function (glBlendFunc(GL_DST_COLOR,GL_ZERO); ) then enable the second channel and set the 'draw over the blackened parts' blend function (glBlendFunc(GL_ONE,GL_ONE); ). Then draw the quad/triangle/polygon.
If you know this already, ignore it.
EDIT: stupid ; and ) made a
[edited by - Tree Penguin on February 6, 2004 5:42:59 AM]
If you know this already, ignore it.
EDIT: stupid ; and ) made a
[edited by - Tree Penguin on February 6, 2004 5:42:59 AM]
I forgot:
use blend mode glBlendFunc(GL_SRC_ALPHA,GL_ONE);
And make the textures combine by t1R*t2R etc.
use blend mode glBlendFunc(GL_SRC_ALPHA,GL_ONE);
And make the textures combine by t1R*t2R etc.
i know the blending process but i want to cut down the rendering time bcause i have 2 render 2 polygons in order for it to work. multitexturing lets me do it all in one polygon. at least thats my goal...
quote:Original post by adam17 for example i want a particle system of bubbles, stars, or blood. i just want to draw a color and cut out the rest of the polygon with a mask.For that you don''t need multitexturing. You need alpha blending.
You should never let your fears become the boundaries of your dreams.
Would it work to set the alpha of the texture to .5, and the alpha of the part of the mask you want drawn to .5, the part you want cut to 0, and set the alphafunc to only draw where alpha equals 1? That way the only parts that are 1 are the textured area and the part of the mask texture you want to keep.
k i now have that working. i have another problem which could be a EASY fix but im not seeing it. i have a sky w/ a noise map applied to it so it looks like clouds. then i have rain drops falling from it. keep in mind both of these are blended quads. is there any way to keep these 2 objects from blending with each other?
Can you describe it with a little more detail, right now i don''t really understand the problem.
take 2 polygons w/ masked textures. seperate they look fine but move one on top of the other and they blend. on top of a nonblended polygon they dont blend. clearer?
This is caused by depth testing.
Now, the particles drawn are sometimes tested away by a previous drawn particle as they are behind it.
Either turn off the depth mask ( glDepthMask(false); ) when drawing the particles or sort them by depth (draw from far to near).
Now, the particles drawn are sometimes tested away by a previous drawn particle as they are behind it.
Either turn off the depth mask ( glDepthMask(false); ) when drawing the particles or sort them by depth (draw from far to near).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement