Order of displaying transprent and nontransparent objects ?????


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,

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

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.



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

Thank U