Archived

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

BlimeyOReilly

transparency

Recommended Posts

BlimeyOReilly    122
hi people! ive got a problem that i dont know how to solve. This is the scenario. I have a spaceship that the player controls...when the player hits an enemy object, its shields come up represented by a sphere quadric. i have blended the texture on this sphere so it is transparent...problem is it wont render anything within the sphere...yet the sphere is transparent to things behind it. Is there anyway to make the spaceship render within the sphere?

Share this post


Link to post
Share on other sites
ZealousElixir    256
To make this work properly, you''ll have to draw what''s in the sphere first, then draw the faces of the sphere from back to front. Since you''re using a quadric, this second step may be impossible, but you at least need to render the contained object (with depth testing enabled) before the transparent container (with depth testing disabled).

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

Share this post


Link to post
Share on other sites
Ostsol    122
Need more information. What are your blending parameters and in what order are you rendering the ship and sphere?

EDIT: My own solution for rendering an object enclosed by a transparent object is as follows:

Set blending to GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA. Next, turn on front-face culling and draw the enclosing, transparent object. This will draw the back of the object only. Next, switch face culling to back-face culling and draw the enclosed object, then the enclosing object again.

[edited by - Ostsol on March 29, 2004 6:56:35 PM]

Share this post


Link to post
Share on other sites