"Suppose you were an idiot, and suppose you were a member of congress; but I repeat myself."
- Mark Twain
More pages: 1 2
New dynamic lightmapping demo
Sunday, August 20, 2006 | Permalink

As you've probably noticed, there haven't been many demos lately, mostly due to lack of time. But now I've finally finished this project that's been laying around for a while. It's generating lightmap dynamically on the GPU. On the first run it will generate four position maps, so it may take up to maybe 10 seconds to load. Later runs will start much quicker.

Enjoy!

Name

Comment

Enter the code below



NeARAZ
Tuesday, August 22, 2006

Why exactly the position map is needed? Can't you just compute world space position at vertices and pass that to the fragment? Or is it this "push out a bit" thing to avoid intersections?

Humus
Tuesday, August 22, 2006

That's one reason. The other is that lightmaps will require some padding around each rectangle to avoid artifacts with a linear filter. With a position map this is very easy, the padded pixels can just have the same positions in the position map. Using the world space position it would be pretty tricky to do this padding. I'm not sure what would be faster though. The position map naturally consumes bandwidth, on the other hand I can render everything with a single primitive, whereas using the position directly would save the bandwidth, but need to render not only the triangles in the scene but also triangles to pad the lightmaps so the final count is triple that of the triangles in the scene, plus that that will add inefficiencies at rasterization.

Btw, I've fixed the resize bug.

NeARAZ
Wednesday, August 23, 2006

Yeah, I see the point. The alternative to padding could be just rendering lightmap without it, and then do some kind of dilation filter on the GPU (that only spreads out to ontouched areas etc.). Anyways, a nice demo!

es
Thursday, September 7, 2006

Hi. Emil i saw you in credits of Prey. What is the story ?

es
Saturday, September 9, 2006

>sqrt[-1]

thanks

metrix
Monday, September 18, 2006

Hi Humus,

I'm getting a "couldnt create render target"
messagebox. I'm using GeForce FX 5900.
Too old a card?

cheeses
Monday, July 23, 2012

try me

what
Monday, July 23, 2012

what's this

More pages: 1 2