Skip to main content
gamedev.net
🔒 Locked

lightmap calculation speed

Started by Fish HF Aug 30, 2003 at 12:00 PM 8 replies 700+ views
Original Post
Fish HF
Fish HF
Currently I''m using raytraced vertex lighting, I''m going to move to lightmaps soon, but my vertex lighting calculation is sloooow(sometimes takes a minute or more), If i changed to lightmapping it''ll be slower, and tips on optimizing it''s speed?
quasar3d
quasar3d
that''s something you have to live with. and a minute for lighting a whole level really isn''t much. You can make it faster with optimizing, and using an octree or bsp structure for your world, so you don''t have to test a ray against every face. but it will always take some time. and if you add radiosity to it, it will surely take more than a few hours to light a level.

btw. go to gollum.flipcode.com. he made a renderfarm just to compute lightmaps. so radiosity is slow enough to build a render farm for it.

My Site
Ysaneya
Ysaneya
Cache your raytraces. Ex.: chances are, if a lumel is shadowed by a triangle X, its neighboor will also be. Test X in priority, then do your standard algorithm.

Y.
Fish HF
Fish HF
i think i know why mines is slow, i did:

for allights
for allfaces
next
next


should be

for allfaces
for alllights
next
next


(i dont use VB, i use vc++, but i still like basic:D)
quasar3d
quasar3d
what''s the difference, except for maybe some more efficient cach use?

My Site
janos
janos
use a form of bsp, or you''ll die before your trace is done on large objects
esp if you do radiosity
With a octree, you can expect 100000 rays/s on a 100000 triangle mesh.
Act of War - EugenSystems/Atari
Fish HF
Fish HF
think that theres 100000 triangles, 100lights

for allights
for allfaces
if(bLightCanTravelToFace)
calclights()
next
next

you''ll have to loop the 100000 triangles 100 times

should be

for allfaces
for alllights
if(bLightCanTravelToFace)
calclights()
next
next

you''ll have to loop the 100000 triangles 1 time
JuNC
JuNC
Yeah, but if you''ve got one hundred lights, you still execute the inner code 100*10000 times. You might have acceleration structures which work better that way round, but the code you posted has equivalent time complexity

Topic Locked

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

Sign in to reply to this topic.