Cipping with D3DX

Started by
1 comment, last by Doddler 23 years, 11 months ago
Ok, here''s the problem... I''m trying to make a cool effect with D3DX. It''s going to be a portal. When I say portal, I''m not talking about a portal engine, I''m talking like a gateway. Your going to be able to look at the portal from all angles, and see another ''world'' on the other side. I know I can do this with 3d clipping, as in the clip mirror example. If I set the clip points to the outside of the portal, and render the scene beyond, it''ll give me what I want... but there''s a problem. If I render the other scene through the portal, any object that''s already been rendered in the clipping area will apear mess up the apearance of the portal... I could clear the zbuffer within the clipping area, but that means that any object obstructing view of the portal will also be cleared. I''m unclear as to how to do such a scene. If anyone knows how to solve this problem, it would be greatly appreciated . Thanks everyone for your time! -Doddler
Advertisement
Assuming your world is divided into sectors, and areas on opposite sides of a portal are different sectors, is there some way you can guarantee that the sector containing the camera is drawn last? This would allow you to clear the z-buffer, draw the sector beyond the portal, and then draw the current sector, allowing objects in this sector to obscure the view of the portal. I''m not confident it''s a good method, but it might work, depending on your engine.
Ok, that just might work! Actually, I found source on www.ati.com''s RAGE128 sdk, it doesn''t require a rage card, but it''s got some pretty nifty source examples, one of which is rendering to a texture to create a portal . Either way, just to get a little more knoledgeable on the subject, how would I clear a certain part of the ZBuffer? If I cleared the ZBuffer while the clipping is still set, will it only clear the clipping area?

Anyways, thanks for the help! I''ll see what I can make out of it!

-Doddler

This topic is closed to new replies.

Advertisement