problem with portals

Started by
2 comments, last by kRogue 18 years, 1 month ago
Hello! I want to render indoor scenes using portals and sectores. I just started and already have problem. I want to use portals as teleportes. now: Free Image Hosting at www.ImageShack.us wanted: Free Image Hosting at www.ImageShack.us The blue quad is the portal and the rest is the sector. I only want to see the lines/triangles/objects inside the portal. Is there a easy and fast way to do this? I looked for tutorials, but they couldn't help, because the used portals as doors and windows and because of this they don't have the problem. Berion
Advertisement
Well isn't your blue quad a "door"? If the effect you wish to achieve is seeing something only through a certain object on screen, you could just use that door technique (probably stencil buffer + clipping plane). In more complex cases you might render the stuff on the other side of the portal to a texture and then use it on your quad or other shape.
any particular reason why you are doing it in wireframe?
is this a hardware or software engine?

My own portal engine is hardware accelerated, consequently.... I just use the Z-Buffer, and don't really care about getting the specifics of clipping stuff against portals, I only test if Any portion of the next sector is visible thru the portal, then render the whole thing
One way to do this (in hardware) is to draw a quad of your portal, and use the stencil buffer... specifically:

draw your quad for the portal with writing to the stencil buffer, say value=1
then draw stuff "on the other side" but enable stencil testing with value==1.


Note: you need to draw the full quad, not jsut the outline (and of course clear all the buffers including stencil between frames).

Best Regards

-Kevin
Close this Gamedev account, I have outgrown Gamedev.

This topic is closed to new replies.

Advertisement