POV-Ray : Newsgroups : povray.binaries.images : My own radiosity implementation Server Time
18 Nov 2024 06:19:42 EST (-0500)
  My own radiosity implementation (Message 1 to 7 of 7)  
From: Slime
Subject: My own radiosity implementation
Date: 28 Oct 2005 06:38:55
Message: <4361ffbf@news.povray.org>
This isn't POV-Ray. I just wanted to share an image I'm proud of. This is a
screenshot from a level editor for a game I'm working on, showing off my own
implementation of radiosity. Lighting is calculated per-vertex.

Only one iteration has been done, and it took 10 or 15 minutes to run, so I
have some work to do to make it more efficient...

Time for bed.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message


Attachments:
Download 'myfirstradiosity.jpg' (79 KB)

Preview of image 'myfirstradiosity.jpg'
myfirstradiosity.jpg


 

From: Tim Nikias
Subject: Re: My own radiosity implementation
Date: 28 Oct 2005 09:44:55
Message: <43622b57@news.povray.org>
> This isn't POV-Ray. I just wanted to share an image I'm proud of.

And you surely can be proud of it! Looks great and smooth! I'd be interested
to see an image of the 2nd and 3rd iterations, if thats possible yet.

What kind of game is it, and will it be available somewhere, sometime? :-)

Regards,
Tim

-- 
aka "Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Tek
Subject: Re: My own radiosity implementation
Date: 28 Oct 2005 13:04:28
Message: <43625a1c$1@news.povray.org>
Very impressive.

By sheer coincedence we've been having some problems with our radiosity at 
the games company I work at (Naughty Dog), so I'd be really interested in 
knowing some technical details: How many vertices are in the scene? What 
radiosity method are you using? It looks too smooth to just be gathering 
photons. Have you applied any filters to the result to make it so smooth?

Cheers,
Tek
http://evilsuperbrain.com


"Slime" <fak### [at] emailaddress> wrote in message 
news:4361ffbf@news.povray.org...
> This isn't POV-Ray. I just wanted to share an image I'm proud of. This is 
> a
> screenshot from a level editor for a game I'm working on, showing off my 
> own
> implementation of radiosity. Lighting is calculated per-vertex.
>
> Only one iteration has been done, and it took 10 or 15 minutes to run, so 
> I
> have some work to do to make it more efficient...
>
> Time for bed.
>
> - Slime
> [ http://www.slimeland.com/ ]
>
>
>


Post a reply to this message

From: Slime
Subject: Re: My own radiosity implementation
Date: 28 Oct 2005 15:07:30
Message: <436276f2@news.povray.org>
> And you surely can be proud of it! Looks great and smooth! I'd be
interested
> to see an image of the 2nd and 3rd iterations, if thats possible yet.

OK, I'll post another image when I get to that point.

> What kind of game is it, and will it be available somewhere, sometime? :-)

Probably a "sort of" FPS deathmatch game. I'm trying to strike a balance
between making it good and actually finishing it someday. =) It's kind of a
big project, and although I have a small amount of the gameplay programmed,
mostly I've just done probably about 75% of the level editor.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Slime
Subject: Re: My own radiosity implementation
Date: 28 Oct 2005 15:22:31
Message: <43627a77$1@news.povray.org>
> Very impressive.

Thanks =)

> By sheer coincedence we've been having some problems with our radiosity at
> the games company I work at (Naughty Dog), so I'd be really interested in
> knowing some technical details: How many vertices are in the scene?

15106, so it seems to be doing a little over 1000 a minute (ow).

> What
> radiosity method are you using? It looks too smooth to just be gathering
> photons.

Pretty much exactly what's described here:
http://freespace.virgin.net/hugo.elias/radiosity/radiosity.htm only without
light maps or the memory address trick they talk about at the end (so no
possibility for HDR lighting).

The two major bottlenecks in my implementation are the rendering of the
scene itself (there's no visibility algorithms yet so the entire object is
drawn for every vertex, and needs more optimization) and the retrieval of
the render to calculate the (weighted) average color (I'm using glReadBuffer
which appears to be extremely slow). I'm hoping to find a way to do the
latter part with OpenGL itself so I don't have to use glReadBuffer. I'm
rendering all parts of the hemicube at 256x256 or 256x128.

> Have you applied any filters to the result to make it so smooth?

Nope, just normal triangle interpolation between the vertices. All light
comes from the environment cubemap, so there are no point light sources
which would make sharper shadows.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Slime
Subject: Re: My own radiosity implementation
Date: 28 Oct 2005 16:21:10
Message: <43628836$1@news.povray.org>
> glReadBuffer

Er, glReadPixels

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Tek
Subject: Re: My own radiosity implementation
Date: 29 Oct 2005 14:04:30
Message: <4363b9ae@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote in message 
news:43627a77$1@news.povray.org...
>> How many vertices are in the scene?
>
> 15106, so it seems to be doing a little over 1000 a minute (ow).

Ah, well that explains why we haven't been using this technique at work (our 
photon-based method takes only a couple of hours for a 3 million vertex 
scene! But the results aren't as smooth as this).

In fact that time of 1000 a minute is hardly surprising. Rendering a cube 
map at every vertex that means you're rendering 100 frames per second, and I 
doubt if you'll get it much faster than that on a good game level.

> The two major bottlenecks in my implementation are the rendering of the
> scene itself (there's no visibility algorithms yet so the entire object is
> drawn for every vertex, and needs more optimization) and the retrieval of
> the render to calculate the (weighted) average color (I'm using 
> glReadBuffer
> which appears to be extremely slow). I'm hoping to find a way to do the
> latter part with OpenGL itself so I don't have to use glReadBuffer. I'm
> rendering all parts of the hemicube at 256x256 or 256x128.

It should be possible to sample your cube maps down to one pixel with GL 
itself, then maybe do this for several of your points so you end up building 
up a texture where each point represents the lighting value for 1 vertex. 
Then you can read them all at once with one read call instead of many. But 
afaik there's no efficient way within GL to apply those values to the 
vertices, you'll have to read them back at some point.

>> Have you applied any filters to the result to make it so smooth?
>
> Nope, just normal triangle interpolation between the vertices. All light
> comes from the environment cubemap, so there are no point light sources
> which would make sharper shadows.

Interesting. I'd be very interested in seeing this on a more organic-shaped 
model, I suspect it's going to struggle a bit when you have sharp points or 
grooves in your shapes.

-- 
Tek
http://evilsuperbrain.com


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.