Calculating LightMaps....

Started by
2 comments, last by BlackScar 23 years, 11 months ago
Does anyone know how to calculate lightmaps? Please help! Justin Eslinger
~-=-=-=-=-=-=~~Justin Eslinger~~.."BlackScar"..~~-=-=-=-=-=-=~
Advertisement
Hej Justin,

Smooth gouraud shading for example:
- Calc a normal for every vertex
- Transform pos of lightsource from worldpos to objectpos (this is the tricky part...use inverse matrix transformation)
- for every vertex: calculate the angle between two vectors (vertex normal and vertex/line drawn from lightsource and vertex). To calc this angle use the dot product.

There''s also phong mapping:
- Like projecting x&y screen coords: project the x&y of the vertex normal to the lightsource (not the screen).
- interpolate like a texture
- Use a phong map (like a texture) to calc the intensity.

This is a verrrry compact explanation,
Hope it helps,
Bas.

(For more info: baskuenen@hotmail.com or check out my homepage: www.baskuenen.myweb.nl (my 3d engine with some 3d tutorials)
Hi,

I''ve written a tutorial on how to calculate lightmaps. Check it out.

Greets Tobias
Cool! Thanks alot guys! I should be able to calculate it now in my map editor. Thanks again!

Justin Eslinger
"Quell - to kill, to torment, to reduce into submission"
http://members.xoom.com/Blackscar
~-=-=-=-=-=-=~~Justin Eslinger~~.."BlackScar"..~~-=-=-=-=-=-=~

This topic is closed to new replies.

Advertisement