Skip to main content
gamedev.net
🔒 Locked

3D Lightmaps

Started by david_williams Dec 1, 2001 at 9:43 AM 7 replies 1.9k views
Original Post
david_williams
david_williams
Hi guys, I read an article at http://www.sgi.com/software/opengl/advanced97/notes/node71.html#SECTION000102200000000000000 about using 3D lightmaps for your scenes. This is something I had never thought of, and it seems like a really good idea. Has anyone tried anything like this in a game, and how well did it work? Thanks in advance, David
david_williams
david_williams
It''s true that a 3D lightmap would use a lot of memory, but if you think about it you only need 1 of them, because their all the same!
Also if you have a light which affects polygons upto 5 meters away (=> 10 meters radius) from it and you want a resolution of 1 pixel per 10cm (which should be plenty with anti-aliasing) then you''ve got 100*100*100 = 1Meg in greyscale. OK so it''s quite big but with todays computers having 512Meg it doesn''t seem so bad.
As for it not being supported, it has been in the OpenGL spec since 1.1 as an extension, and 1.2 as a proper part, and we''re now on 1.3. There should be support for most people.
It seems such a flexable way to do lighting. There would not need to be any pre-calculations, and it could be truly dynamic both in time and space.
One thing i did think of however, is does anybody know if the ARB_Multitexture extention supports 3D textures? It would be helpful for multiple lights.
david_williams
david_williams
But i wasn''t thinking of making it contain shadow information. You would just have one light map which was bright at the middle and darker to the edges. You would then be able to do multiple lights just by centering the texture on each light, and blending the results together. That''s why the ARB_MULTITEXTURE extension would be useful.
If shadows were needed they could be done in a traditional way using shadow maps or shadow volumes.
Because the lighting was not pre-calculated lights would be able to move and change in colour and intensity without limitation. I agree it would be slower but i think it would be doable, prehaps the user could change the resolution of the light map to support thier system.
The advantage over DOT3 lighting (by which i assume you mean per-vertex lighting) is that the lighting would change correctly across the polygon. Though I agree that the visual improvment from this may not be enough to justify the slowdown.
PinkyAndThaBrain
PinkyAndThaBrain
Using a 3D texture to solve a 1D problem (getting a distance based per pixel attenuation function) is not a very good use of resources. There are per pixel lighting technique''s to do it too, try this one for instance for one which will work on GeForce''s and up.
MButchers
MButchers
Here is a link to the ati site,
contains a few demos of 3d texturing
including a bit on lighting

http://www.ati.com/na/pages/resource_centre/dev_rel/sdk/radeonsdk/Html/Samples/Samples.html#OpenGL

as for the memory required I believe they can be compressed so this is not such an issue.

Mark.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.