Jump to content
  • Advertisement
Sign in to follow this  
Fish HF

creating lightmaps with the video card

This topic is 4854 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!