Page 1 of 1

Portal Rendering

Posted: Thu Jan 20, 2005 12:50 am
by Electron
I'm working on making portal rendering possible with irrlicht. See thsi thread on NX forums http://www.irrlichtnx.mmdevel.de/phpBB2 ... =1362#1362

I have a demo up. The portal rendering is working, but i don't yet have a way to tell when nodes move from sector to sector.

Posted: Sun Jan 23, 2005 1:49 pm
by Electron
Ok, I got the sector recomputation thing working. Download the demo here (self-extracting archive) The camera will automatically change into the next sector as it moves through doorways. Generally this is quite smooth, but unfortunately I do get the occaisonal flicker. Currently I'm not quite sure exactly how I can fix it, though it has something to do with the campos correction code near the top of the CPortalSceneNode::OnPreRender() function.

I have not yet upoaded the new version of the portal rendering code as I want to clean up a couple things first

Posted: Sun Jan 23, 2005 10:05 pm
by Morrog
What's it do? I'm assuming it's implemented the usage of the VIS data from a BSP file?

Posted: Mon Jan 24, 2005 12:02 am
by Electron
Not at all. Absolutely nothing to do with BSP and it is not PVS either. Portal rendering is a dynamic culling technique that works on the object level. (It is not good for level meshes as the whole things is one node. I'm now working on a PVS system but that could be alittle while still)

Portal rendering requires portals to be created in an outside editor. Each portal is defined by four points (top-left, top-right, bottom-right, and bottom-left). The points must be passed to smgr->addPortalSceneNode in that order. These points are used to construct culling planes to cull unseen geomtry. The other important concept in portal rendering is sectors. Basically, a sector is an area, usually a room intuitively. All openings from one sector to another (such as doorways, windows) must be covered by portals. Whe nthe application starts the user must set which sector each node is in. The portals will then autodetect when nodes pass through them and switch their sectors.
I got a lot of my info about portal rendering and how to do it here
http://www.flipcode.com/portal/ though this ais a very old column about how to implement portal rendering with a software 3D engine.

Here are a couple screenshots of the editor I placed the portals for the demo in. Unfortunately this editor is game-specific for my project. If this portal renderign generates enough interest hopefully one the people making an irrlicht scene editor will incorporate portal placement.

Image
Image

Posted: Mon Jan 24, 2005 1:36 pm
by Electron
Uploaded the updated portal rendering code for Irrlicht. Download it here http://crucibleofstars.sourceforge.net/ ... dering.zip

Everything should be working in this code.