DevMaster.net Forums
[[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]]

Go Back   DevMaster.net Forums > Site Discussions > Articles Discussion
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 09-21-2003, 08:55 PM   #1
DmEditor
DevMaster Editor
 
Join Date: Jan 2005
Posts: 54
Default

Radiosity and BSP-Tree Rendering
Author: Samuel Ranta-Eskola
Description: This article gives an overview of how the radiosity algorithm (a lightning model) works and focuses on how BSP-trees can be used to optimize the calculations.

Reply to this post for any comments/suggestions/questions.
DmEditor is offline   Reply With Quote
Old 02-29-2004, 10:13 PM   #2
gfaraj
New Member
 
Join Date: Feb 2004
Posts: 8
Default

Hi,

I read this tutorial and I found it very interesting. I have implemented a BSP with PVS compiler for my game engine and I was interested in adding pre-rendered lighting to it.

I think I understand what I have to do to transfer the energy from one patch to another, but I'm not sure how to divide my level into patches and how to render my scene after the radiosity calculations...

This really doesn't say much about rendering with the RADIOSITY changes...

Code:
► RENDER-SCENE * Indata: * Scene – The scene to render as a BSP-tree * Outdata: * A BSP-tree * Effect: * Renders a BSP-tree out of the information stored in the scene. RENDER-SCENE (Scene) // Render the BSP-tree using the objects that describes the geometry // of the scene 1 GeometryPolygons f {} 2 for (each object O that belongs to the geometry of Scene) 3 GeometryPolygons f GeometryPolygons U O.PolygonSet 4 GENERATE-BSP-TREE (Tree.RootNode, GeometryPolygons) // Distribute the sample points in the leaves of the tree. 5 DISTRIBUTE-SAMPLE-POINTS (Tree.RootNode, {}) 6 TRACE-VISIBILITY (Tree) 7 for each object O that is a static object in Scene 8 for each polygon P in O 9 PUSH-POLYGON (Node, P) // CREATE-PATCHES is an undefined function that needs serious // consideration. Our solution of this problem was not good enough, so // we choose not to present it. 10 CREATE-PATCHES (Tree) 11 RADIOSITY (Tree)

Is there an article on this too? I would really appreciate your help.

Thanks,
George Faraj
FX-Legends
gfaraj is offline   Reply With Quote
Old 03-01-2004, 01:30 AM   #3
anubis
DevMaster Staff
 
anubis's Avatar
 
Join Date: Apr 2003
Location: Germany
Posts: 2,328
Default

i don't think there is one yet. someone might start to write one now though... maybe you want to write one after you've done some research and implemented your renderer ???
___________________________________________
If Prolog is the answer, what is the question ?
anubis is offline   Reply With Quote
Old 03-01-2004, 01:41 AM   #4
gfaraj
New Member
 
Join Date: Feb 2004
Posts: 8
Default

Quote:
Originally Posted by anubis
i don't think there is one yet. someone might start to write one now though... maybe you want to write one after you've done some research and implemented your renderer ???
And how do you explain that screenshot with the two differently rendered rooms?
gfaraj is offline   Reply With Quote
Old 03-01-2004, 09:08 AM   #5
anubis
DevMaster Staff
 
anubis's Avatar
 
Join Date: Apr 2003
Location: Germany
Posts: 2,328
Default

Samuel Ranta-Eskola obviously implemented such a renderer. i do not know if he checks the forums regulary. if so he might be willing to come up with another tutorial
___________________________________________
If Prolog is the answer, what is the question ?
anubis is offline   Reply With Quote
Old 03-01-2004, 06:43 PM   #6
gfaraj
New Member
 
Join Date: Feb 2004
Posts: 8
Default

Yeah.

Samuel, on what should I base my patch divisions? I have read an article on a LOD system called ROAM and it shows how to create patches of my polygons. Could this be the same method, or is it totally different?

About rendering, how are the radiosity values applied to the textures?

Thanks.
gfaraj is offline   Reply With Quote
Old 03-02-2004, 02:12 AM   #7
anubis
DevMaster Staff
 
anubis's Avatar
 
Join Date: Apr 2003
Location: Germany
Posts: 2,328
Default

probably apex still has his mail address...
___________________________________________
If Prolog is the answer, what is the question ?
anubis is offline   Reply With Quote
Old 03-02-2004, 02:59 PM   #8
gfaraj
New Member
 
Join Date: Feb 2004
Posts: 8
Default

I sent him an email through his profile and asked if he would please look at this discussion. I hope he has a chance to read it

What's the difference from radiosity and shadow mapping? Is it almost the same thing?

Thanks.
gfaraj is offline   Reply With Quote
Old 03-02-2004, 03:45 PM   #9
Noor
Senior Member
 
Join Date: Jan 2003
Location: ON, Canada
Posts: 524
Default

Quote:
I sent him an email through his profile and asked if he would please look at this discussion. I hope he has a change to read it

What's the difference from radiosity and shadow mapping? Is it almost the same thing?

He will He is always around

If you go to the article and click on the author’s name, you'll get Samuel email address... anyways here is his email; as I recall he is a member here.

samme(AT)starbreeze.com ' just substitute (AT) with @

Once you email him, please kindly ask him if you could reply here in the forums instead of just emailing you the answer... There might be other people having the same question...
___________________________________________
"What ever happened to happily ever after?"
Noor is offline   Reply With Quote
Old 03-02-2004, 04:07 PM   #10
gfaraj
New Member
 
Join Date: Feb 2004
Posts: 8
Default

Thanks

I already sent him an email, and would not like to get on his nerves sending him another one :P

I didn't give him my email, so I'd guess he will post here.
gfaraj is offline   Reply With Quote
Old 03-02-2004, 04:26 PM   #11
Noor
Senior Member
 
Join Date: Jan 2003
Location: ON, Canada
Posts: 524
Default

Quote:
Thanks

I already sent him an email, and would not like to get on his nerves sending him another one

I didn't give him my email, so I'd guess he will post here.

No problem.

FYI, if you sent him an email via the forums, whatever email you registered in here shows up in his email.
___________________________________________
"What ever happened to happily ever after?"
Noor is offline   Reply With Quote
Old 03-03-2004, 03:31 AM   #12
Mihail121
Senior Member
 
Mihail121's Avatar
 
Join Date: Jan 2003
Posts: 868
Default

Don't worry guys, Samuel will answer.

He always gives detail descriptions and explanations over the stuff. I've send him some questions regarding the BSPs once and he was kind enough to explain me how stuff actually are.
Mihail121 is offline   Reply With Quote
Old 03-05-2004, 10:33 PM   #13
gfaraj
New Member
 
Join Date: Feb 2004
Posts: 8
Default

gfaraj is offline   Reply With Quote
Old 03-14-2004, 12:55 AM   #14
gfaraj
New Member
 
Join Date: Feb 2004
Posts: 8
Default

Anyone know if Samuel knows we're asking questions?
gfaraj is offline   Reply With Quote
Old 03-15-2004, 01:47 AM   #15
Samuel
New Member
 
Join Date: Sep 2003
Location: Uppsala, Sweden
Posts: 8
Default

Hi guys

Sorry that it took me a while before I saw this thread. I've just switched jobs and haven't been in here in a while. You are always welcome to notify me on krassa@hotmail.com if new questions has come up or if you want to ask me something

Anyways, I'll do my best to answer your questions.

I implemented a fully working radiosity renderer, but I found my method of approach to be rather clumpsy so I chose to not include it my article. But I can give you all a brief explanation of how I did it, and of other suggestions on how to to it.

When I did the renderer the graphic cards weren't as good as they are today (surprise? , so I wanted to keep shared vertices between the polygons. This is not necessary today. That makes it a lot easier to distribute the patches in the scene. A short algorithm on how to allocate patches would look like this:

Code:
1. Decide a resolution , i.e. how big a patch should be in world coordinates. 2. For each polygon in each node do the following steps 3. If you can fit the polygon into an existing lightmap allocate that area, otherwise create a new lightmap. 4. Each pixel in the lightmap that i located within the new polygon is a patch. Add the patches to the node.

In step 1 we decide how finely grained the lightning is going to be, the bigger resolution the longer time the rendering will take and the more memory the lighmaps will consume. I think I went with something like 25x25 cm. Remeber that bilinear filtering makes it better looking.

Step 3 is the tricky part. How do we fit a polygon into a lightmap? When I did my renderer I unwrapped a whoole mesh onto a lighmap, that was tricky!! If you go the easy way and just consider the polygon to be twodimensional and put it on the light map it's not a big problem. Remember to write a good allocation manager for the light maps, otherwise you'll waste a lot of memory! You must also remember that bilinear filtering will filter to the next pixel in the lightmap so you must leave some room in between the polygons, otherwise you'll get strange artefacts.
If you decide to use shared vertices you can save A LOT of texture memory on the lighmaps since many polygons can lie edge to edge + that you'll problably get a better lightning result. But the first test should be to alloc one polygon at the time.
It's a bit hard to describe this, but I've started at least so if you ask follow up questions I think I can clarfiy some points.

Step 4 is really easy when you have allocated the polygon. Just loop through the pixels in the the area the polygon covers in the lightmap. For each pixel, calculate world space coordinates of that patch (you can easily do it from the polgyons plane equation). Add the patch to node.

Now you got a lot of patches in the scene, start sending energy and then convert the energy in to light values using some good algorithm.
Samuel is offline   Reply With Quote
Old 03-15-2004, 01:52 AM   #16
anubis
DevMaster Staff
 
anubis's Avatar
 
Join Date: Apr 2003
Location: Germany
Posts: 2,328
Default

thanks for the reply
___________________________________________
If Prolog is the answer, what is the question ?
anubis is offline   Reply With Quote
Old 03-15-2004, 05:02 AM   #17
Noor
Senior Member
 
Join Date: Jan 2003
Location: ON, Canada
Posts: 524
Default

Samuel, thanks for the reply. I do highly recommend that you edit your post and put some spaces between @ sign or anywhere else in your email address just to confuse spammers.
___________________________________________
"What ever happened to happily ever after?"
Noor is offline   Reply With Quote
Old 03-15-2004, 07:35 AM   #18
Samuel
New Member
 
Join Date: Sep 2003
Location: Uppsala, Sweden
Posts: 8
Default

That e-mail adress is already so f-cked up by spamming that I don't care anymore
Samuel is offline   Reply With Quote
Old 03-16-2004, 12:36 AM   #19
gfaraj
New Member
 
Join Date: Feb 2004
Posts: 8
Default

Samuel, thanks for the reply. I'll try to digest it more later and try to come up with new questions. Thanks a lot
gfaraj is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump


All times are GMT -7. The time now is 08:31 AM.


Powered by vBulletin
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.