Portal Rendering

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Portal Rendering

Post 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.
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post 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
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Morrog
Posts: 58
Joined: Mon Dec 13, 2004 5:13 am

Post by Morrog »

What's it do? I'm assuming it's implemented the usage of the VIS data from a BSP file?
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post 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
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post 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.
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Post Reply