Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

adam17

Multitexturing Project

This topic is 5216 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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]

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!