Archived

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

burnseh

blending not quite working ...

Recommended Posts

burnseh    122
hello, I''m having some trouble with blending. Transparent objects don''t show up quite right when theres an opaque object behind it. Best way to describe this is to show you.. heres an exe i uploaded: http://www.postmodernist.com/richard/SolarSystem001.rar Currently, the objects are drawn in the following order: 1. the earth (opaque) 2. earth''s clouds (alpha = 0.7) 3. earth''s atmosphere (alpha = 0.5) 4. earth''s moon (opaque) 5. the sun thanks for any help, rich

Share this post


Link to post
Share on other sites
mkaltner    122
From what I've done with this subject, is that when doing blending of different 3D objects, you need to disable the depth mask when drawing the blended object.

Something like:

// draw non-blended objects here

glEnable(GL_BLEND);
glDepthMask(GL_FALSE);

glBlendFunc(GL_SRC_ALPHA, GL_ONE);

// draw blended object here

glDepthMask(GL_TRUE);
glDisable(GL_BLEND);

Play around with that and see if you can get what you want.

- Mike

P.S. I didn't download the program (rar format is not popular, use zip) so this may not be correct.

EDIT: typo

Edited by - mkaltner on November 8, 2001 7:01:30 PM

Share this post


Link to post
Share on other sites
burnseh    122
thanks for the reply

I tried the depthmask true/false and it works. I was using it already but in the wrong way.

much appreciated


btw, uploaded as .zip, use down arrow to move back a bit so you can see the sun

Share this post


Link to post
Share on other sites