Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / can somone explain to me what a lightmap is?

Author
Message
Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 18th Oct 2004 05:50
I have no idea what these are and i've heard the term being thrown around a bit. Plese explain

I discriminate against discriminating people....
RalphY
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: 404 (UK)
Posted: 18th Oct 2004 06:15 Edited at: 18th Oct 2004 06:16
In simple terms a lightmap is a texture which is cast over your levels/objects which adds shadows etc. For an example on the Cartography shop page of this web site somewhere there is an image of a church with light shining through the windows, this would be done using a light map. They are much quicker than calculating the lighting at real time (as they are pre-rendered), however they generally only work for static objects.

Hopefully this information isn’t too wrong and helps
Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 18th Oct 2004 07:02
that sounds useful. How do I make one and how much dose it affect the fps?

I discriminate against discriminating people....
RalphY
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: 404 (UK)
Posted: 18th Oct 2004 07:35 Edited at: 18th Oct 2004 07:36
To produce a lightmap you can use software like Gile[S] or Cartography Shop which will generate lightmaps of your levels for you. FPS wise I'm not sure as I have never used one, but I doubt it would make too much of a difference.
The Wendigo
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 18th Oct 2004 12:32
FPS wise, it should make a big difference as there is virtually no light calculations anymore (unless you do dynamic lightmapping, dont' ask, cuz I don't know how). I would seriously recommend lightmapping over the built in lighting system that DBP supports, but the calculations can get so complex that buying a program to do it for you would probably be the best way to go.


Home of DOOP, Strata Works, and Height
peterjack
19
Years of Service
User Offline
Joined: 17th Oct 2004
Location:
Posted: 19th Oct 2004 01:36
Well, I think I can explain what are lightmaps and dynamic lightmapping, at least if you can understand my English.

A lightmap is an additional texture layer applied to the surfaces (usually scenery) to enhance the appearance of the lighting in a game. The most common lighting method is the vertex lighting, which is based in calculations made in real-time even by earlier graphic adaptors, consisting in the following scheme:
o The graphics engine determines the position of a given vertex of an object, the position of a light (or more) and the intensity of the light source. Through some strange matrix calculations, it receives as result the "brightness" value of the light that reaches the vertex.

o Then, the engine makes the same calculations for the neighbouring vertices, and makes a "dithering" to interpolate the brightness values across the object's surface.

This lighting scheme has two advantages: it is fast, because the calculations required are quite simple, and it's economic (in terms of video memory), because this lighting scheme only requires three non-integer values for each vertex of the object. Perhaps, it has a great disavantage: this method is unable to represent shadow casting over an object.

When we look at a ball over a table, we can observe two things about lighting: the ball seems to be brighter in the direction of the light, AND it produces a shadow over the table, as the light was an observer that painted a darker contour in the table with a silouette of the ball. This shadowing effect can not be reproduced by common vertex lighting, so the lightmaps takes place.

Usually, the game producers use a third-part program for building the lightmaps. This program looks for all lightsources in a scene, and draws in a big (or in many small) textures the sillouettes projected by the lights. This new texture set is mixed with the original textures of the scene, giving the scene the shadows the vertex lighting was unable to reproduce.

Dynamic lightmaps are the same thing, but instead of the light calculation be made by other program, the game engine itself makes the calculations. This is necessary to reallistically make shadows for moving objects (like the game's main character, which casts a moving shadow) and for moving lights (which interfere with the entire scene lighting).

This way, the cost of speed for lightmaps is the cost of applying the additional light textures to the object. For dynamic lightmaps is the same, plus the complex calculations necessary to do the trick. In terms of memory, dynamic and non-dynamic maps are basically the same (the memory occupied by the lighting textures).

That's all, any questions, just mail-me < peterjack@zipmail.com.br >
RalphY
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: 404 (UK)
Posted: 19th Oct 2004 02:21 Edited at: 19th Oct 2004 02:55
Yes, perhaps I should have rephrased my post better. What I meant was it shouldn't make much difference to your FPS if you’re not using any other lighting techniques (basically it won’t slow your game down).
Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 19th Oct 2004 07:01
sounds great thanks guys, I'll go cheack out some lightmap programs now

I discriminate against discriminating people....
FoxBlitzz
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location: United States
Posted: 19th Oct 2004 07:14
Here is a scene I made with Cartography Shop and has a lightmap:

http://www.alpha-works.com/Screenshots/TempleLM.jpg

Just so you have an idea of what a lightmap looks like. On a side note, dynamic lightmapping is not a good idea unless you limit what objects cast shadows, as this can really slow down a game.

HP Pavilion | Intel Pentium 4 CPU 2.40 GHz
512 MB Ram | NVIDIA GeForceFX 5600 AGP, with 256 MB Ram

Login to post a reply

Server time is: 2024-09-23 03:23:09
Your offset time is: 2024-09-23 03:23:09