• Advertisement

Archived

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

Lightmaps

This topic is 6013 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 Russian, so please don''t be surprised with LOTS of mistakes )) I''m writing my own 3D engine in OpenGL, and I''ve met some difficulties in implementation of the lighting system. I''m using lightmaps. Standart lightmap 32x32 consumes about 3 kB of video memory. 30,000 faces - 30 megabytes! How can I load all of this?! I''ve tried to unite lightmaps in bigger 256x256 images, to check faces'' size, and nothing helps! All my algorithms are getting cracked by multiple calls of the gluBuild2DMipmaps function! It''s too slow!!! Help me please :-((( Thanks anyway ))) --Yarik

Share this post


Link to post
Share on other sites
Advertisement
You do not in general make one lightmap per polygon, you make one lightmap per surface. The resolution of the lightmap should not reflect the number of polygons it encapsulates, but rather the size of the object... ie a square wall, with two polygons might have a 256x256 light map, but a vase with five hundred polygons might also have a 256x256 lightmap. In general make 1 lightmap per object, rather than per polygon. The size of the maps you get generated, is really dependant on the lighting algorithm you use... are you using radiosity? or raytracing? Either way, you should be able to make light maps of arbitrary resolution... And these should be precalculated... not calculated at run time. Also the mipmaps are calculated when the engine is initialized... and they only increase the size of the texture by about 1/3rd. So the gluBuildMipmap, may slow down the engine in starting up, but (assuming you are using texture objects) the speed of gluBuildMipmap will not slow down the engine (except in starting). If you feel this is too slow, you can either write your own mipmap generator... or you can include all the mip levels in the texture files.

Share this post


Link to post
Share on other sites

  • Advertisement