Jump to content
  • Advertisement

Archived

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

eloso

OpenGL Lightmapping in opengl

This topic is 6445 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

Advertisement
check the multitexture demo on my site it does lightmappinf with/without multitexture

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
you could also create a set of textures for each map ;o)

takes up a lot of space though and wow.. just thought that it''d take _some_ memory ;o)

cya,
Phil

Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states

Share this post


Link to post
Share on other sites
thank you all. But now i think maybe it''s better to disable lightmaps for those cards that cannot do multitexturing because it is very slow - at least with my engine ;-)

Or is there anything to optimize?
For now i draw every trianglestripe twice; once with disabled depth buffer and then with enabled depth buffer.

Share this post


Link to post
Share on other sites
>>But now i think maybe it''s better to disable lightmaps for those cards that cannot do multitexturing because it is very slow - at least with my engine ;-)<<

engines look crap without lightmapping.
in a worst case senerio doing lightmapping with 2 passes will half the frame rate for those polygons which means in a normal worse case senerio the program will run ±25% slower using 2 passes on cards that dont do multitexturing.
so my advice is do lightmapping for single pass cards.

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
well, on my p3/450 with riva tnt i get 50 fps with and 80 fps without lightmapping. Ok on the tnt i could enable multitexturing, but when i think of a card without multitexturing like the riva128 or voodoo2 the performance hit might be much bigger.

Share this post


Link to post
Share on other sites
u must be swapping a lot of textures. are u grouping all your small lightmaps into larger textures

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
i swap on every triangle-stripe between texture and lightmap. otherwise i couldn''t handle overlapped polygons because i draw them first without depth buffer writing and then within. or did i get something wrong?

Share this post


Link to post
Share on other sites
If I''m not mistaken, what you might want to do is render your geometry with the base textures first with depth writing enabled and no blending. When you do this, you''ll most likely want to do it in such an order that you group triangles with the same texture together; you''ll need to do, say, a quick sort to generate a list, then render. Then, with the depth testing function set to GL_LEQUAL, render your geometry again with the lightmaps using multiplicative blending (GL_ZERO, GL_SRC_COLOR or GL_DST_COLOR, GL_ZERO).

If you want, you can also draw the lightmaps first with no blending, then render the base textures with multiplicative blending.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!