Archived

This topic is now archived and is closed to further replies.

Trond A

Lightmapping

Recommended Posts

Trond A    139
I was wondering if anyone could point me to a _good_ tutorial about lightmapping a scene including shadowing it, and with a pretty good explanation about the math behind it. The ones I have found so far does not cover the aspects I am interested in, or they assume a little too much math skills... Any help is greatly appreciated! -Trond

Share this post


Link to post
Share on other sites
Impossible    134
There's not much, but if you look you can find a decent amount of information. Most lightmapping tutorials just tell you what blend modes to use for multitexturing, which is by far the easiest part of the process. Flipcode has a few nice tutorials (also check polygone.flipcode.com). There is some information on a way to pack lightmaps on blackpawn.com. Hugo Elias (you'd have to google for his site) has an ok tutorial on radiosity. You can also look through the Quake III tools source.

The thing is, you aren't going to find a tutorial on the entire process of lightmapping that doesn't have a lot of math involved. In order to write your own lightmapper you need to have a ton of graphics knowledge (at least raytracing) that relies on a ton of math knowledge. The easiest way to get your own lightmapped level running would be to use someone elses tools (write a Q3A BSP loader or use 3DS Max 6 to bake lighting into a texture) to generate the lightmap and just worry about the rendering.

[edited by - impossible on May 25, 2004 3:37:49 PM]

Share this post


Link to post
Share on other sites
jyk    2094
I''m pretty sure there used to be a basic tutorial on lightmapping at flipcode.com - it may still be there. I believe the topic is also discussed in ''Tricks of the 3D Game Programming Gurus.''

Share this post


Link to post
Share on other sites
Trond A    139
Thanks for the input!

I just recently bought Tricks of the 3D game programming gurus, and it pretty much said what a lightmap was, not how to implement a lightmap generator...

Share this post


Link to post
Share on other sites
Max_Payne    757
quote:
Original post by Impossible
The thing is, you aren''t going to find a tutorial on the entire process of lightmapping that doesn''t have a lot of math involved. In order to write your own lightmapper you need to have a ton of graphics knowledge (at least raytracing) that relies on a ton of math knowledge. The easiest way to get your own lightmapped level running would be to use someone elses tools (write a Q3A BSP loader or use 3DS Max 6 to bake lighting into a texture) to generate the lightmap and just worry about the rendering.


... The only math knowledge you need is linear algebra... Raytracing is not very complicated, its one of the simplest rendering methods. Applying it to lightmap generation is also very easy... Requires a bit of research and some experimentation, but its feasible.



Looking for a serious game project?
www.xgameproject.com

Share this post


Link to post
Share on other sites
Sunray    188
http://members.net-tech.com.au/alaneb/lightmapping.html
http://www.flipcode.com/articles/article_lightmapping.shtml
http://www.flipcode.com/cgi-bin/knowledge.cgi?showunit=79

Good luck and have fun!

Share this post


Link to post
Share on other sites
badsector    184
Yea, tricks turned me down on that topic too. Fortunatelly i had got it with "3D Computer Graphics" by Alan Watt (self note: i have to comment about it someday in the Books section of this site) which included more information on generating the lightmaps. Unfortunatelly that "more" information was 1-2 pages. It took me some time, a lot of coffee assistance but finally i managed to understand what it takes - and it''s simple. The hardest part is to figure our the U, V values for the lumels (the lightmap''s texels) for each triangle. Once you do that, you just do the reverse of what you should do in order to draw a 3d textured triangle in 2d bitmap plane (the screen) if you were using a software rasterizer. In other words: you interpolate the X, Y, Z positions for each lumel and you trace a ray from the lumel''s position in space to all lights and calculate the light value for it, taking in mind any traced polygons between the lumel and the light in order to generate shadows).

I can''t say exactly what to do, since they''re random thoughts. I haven''t yet implemented lightmapping :-).

Share this post


Link to post
Share on other sites
Trond A    139
quote:
Original post by Max_Payne
quote:
Original post by Impossible
The thing is, you aren''t going to find a tutorial on the entire process of lightmapping that doesn''t have a lot of math involved. In order to write your own lightmapper you need to have a ton of graphics knowledge (at least raytracing) that relies on a ton of math knowledge. The easiest way to get your own lightmapped level running would be to use someone elses tools (write a Q3A BSP loader or use 3DS Max 6 to bake lighting into a texture) to generate the lightmap and just worry about the rendering.


... The only math knowledge you need is linear algebra... Raytracing is not very complicated, its one of the simplest rendering methods. Applying it to lightmap generation is also very easy... Requires a bit of research and some experimentation, but its feasible.



Looking for a serious game project?
www.xgameproject.com


Just to clarify: I am not looking for som magic paper making me able to create my own lightmapper w/o any graphic/math skills at all I just thought it would be nice with a fairly good explanation of the math behind it.

The radiosity paper by Hugo Elias was btw very nice!

-Trond

Share this post


Link to post
Share on other sites
Trond A    139
Ah! After a good day of work and linear algebra studying, I have now managed to understand the lightmapping basics :D I can't wait to try out radiosity and thus shadows, which should not be such a huge problem now.



Thanks for the nice links, they were really helpful!

-Trond

EDIT: fixed image link... :/

[edited by - Trond A on May 30, 2004 8:23:35 PM]

Share this post


Link to post
Share on other sites
Impossible    134
quote:
Original post by Max_Payne
quote:
Original post by Impossible
The thing is, you aren''t going to find a tutorial on the entire process of lightmapping that doesn''t have a lot of math involved. In order to write your own lightmapper you need to have a ton of graphics knowledge (at least raytracing) that relies on a ton of math knowledge. The easiest way to get your own lightmapped level running would be to use someone elses tools (write a Q3A BSP loader or use 3DS Max 6 to bake lighting into a texture) to generate the lightmap and just worry about the rendering.


... The only math knowledge you need is linear algebra... Raytracing is not very complicated, its one of the simplest rendering methods. Applying it to lightmap generation is also very easy... Requires a bit of research and some experimentation, but its feasible.



Looking for a serious game project?
www.xgameproject.com

I didn''t say that raytracing or linear algebra was incredibly complicated, but the way he phrased things I thought that he wanted to avoid math entirely. That is obviously not the case.

Nice to know that we were helpful.

Share this post


Link to post
Share on other sites