creating lightmaps with the video card

Started by
4 comments, last by Fish HF 18 years, 9 months ago
I'm going to add code to generate lightmaps soon, but I'll try to use a different approach... First, I'll make the camera to look from the triangle's texel, then it's direction to the triangle's normal... Then, it'll render to a surface, and it'll see if the surface have any lights... Will it be slow? I never heard any one done this before.... thanks
Advertisement
I don't get it...?

Can you maybe explain a little more?

It sounds like this is going to be a seperate application for generating light maps though, so is speed really an issue? I would go with whatever is easier to use.

Matt Hughson
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
This sounds to me a bit like projective texturing - similar to that used in quite a few popular shadowing algorithms...

Have you looked into how they do it?

As a side note, if you can't find anyone else using the same/similar ideas there's often one of two reasons:

1. It's been tried and found not to be very good (or better exists)
2. You're ahead of the game and have found something completely new

Although, as matthughson suggests, a seperate tool might afford you many bigger/better possibilities... For example, complex inter-reflections, shadows and other global illumination goodness.

If you want to know the theory behind a lot of this stuff, you might do well by asking the guys over in Graphics Programming and Theory.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

When rendering the map I wanted to light up, I'll first make the map look black, then make all the lights in the map as a (white) sphere. (sphere with large radius can get soft shadows easily)
After it's rendered to a surface(render to texture), I'll lock the surface(texture), and sum up all the pixels to get the amount of light received on the texel on the triangle, then maybe I'll scale the whole map's lighting to get it to 0-255 or use HDR....

For speed, it's not really a big issue, because it's not done in-game realtime, but if it's way slower than doing the lighting calculation on the cpu, then it'll be a problem...

I hope someone not trying this is not because of it's patented lol
Quote:Original post by Fish HF
When rendering the map I wanted to light up, I'll first make the map look black, then make all the lights in the map as a (white) sphere. (sphere with large radius can get soft shadows easily)

Not sure what you're trying here... Direct3D won't generate any shadows for you, much less soft ones [smile]

I can sort of see what you're trying to achieve, but I think a regular ray-tracer will probably generate much better results, as well as being potentially easier to write [smile]

Have a look at the Articles on Radiosity for some impressive lightmapping algorithms.

Quote:Original post by Fish HF
I hope someone not trying this is not because of it's patented lol

I wouldn't worry about that. I don't know about Hong Kong, but definitely here in the EU software patents aren't enforceable (yet)...

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

http://photos1.blogger.com/blogger/2746/1237/1600/Clipboard01.jpg
It took 5mins to lightmap this simple scene, is it too slow?
(CPU:P4 1.8ghz,video:GF4mx440 go)

lemme explain again,
for each patch/lumel/texel on each triangle
i set the camera's position to be the patch's position, and make it look at each light in the scene
render map with black textures
render lights as white spheres
then render to texture
for each pixel on the texture
sum up the r,g,b values, then multiply it with some dot product stuff, then it'll be the amount of light received on the patch/lumel/texel

This topic is closed to new replies.

Advertisement