View Full Version : Order of displaying transprent and nontransparent objects ?????

02-26-2002, 08:07 PM

I displayed two 3D objects in a window,one object is larger and that covers the small object.I want to give translucent to outer object and can able to see the inner object inside the outer object.When i dispalyed large object seperately with translucent then it has translucent effect.But when i merge both effect then the translucent effect of outer object is lost.I displayed the non translucent object first and translucent object last.

what is the problem ?? Is any problem in the displaying sequence ??

Thanx for any input,

02-27-2002, 01:36 AM
Seems reasonable - Are you sure you're enabling blending? - glEnable (GL_BLEND);

Anyways, the normal operational order is something like this:

1. Disable Z test, Enable Z writes.
2. Draw Background
3. Enable Z Test
4. Draw opaque geometry - in any order
5. Draw Translucent geometry back to front.

Step 2 is typically a skybox, or something else you _know_ will cover the entire screen. Thus steps 1 & 2 does an implicit Z-buffer clear.

Hope this helps

02-27-2002, 03:17 PM
Hm, I would disable both z writes and z test for skybox drawing (and clear the z buffer before rendring things that need z buffer). Else your background may occlude some things - not the way a background is supposed to work.


02-28-2002, 10:34 PM

NicholasFrancis,u are right,i follow ur steps then it is working well,

Thank U