Skip to main content
gamedev.net
🔒 Locked

Lightmapping

Started by Night Elf Jan 19, 2003 at 4:06 PM 1 replies 400+ views
Original Post
Night Elf
Night Elf
What would be the best way to implement lightmapping in DirectX 8? Should I use multi-pass or single-pass multitexturing? Besides, does anyone have any sample code I can look at showing lightmaps (or multitexturing) applied to meshes? Thanks for any help you can give me.
Pseudo
Pseudo
check the device caps, if it supports multitexturing, then use it, otherwise have a backup method that uses 2 passes.
Night Elf
Night Elf
Well, I have implemented both solutions and so far I see the multitexturing one is the fastest.
For testing purposes, and since there are no exporters I know of that can output two coordinates sets form 3DS MAX to an .X file, I am loading two meshes (one textured normally and the other with the lightmap) and making another mesh in memory by merging the other two.
But now I have a problem. If there is only one lightmap for the whole mesh, it''s easy - I just set the lightmap texture in the second stage and render using a SetTexture() - DrawSubset() loop as always. But what happens if I have more than one textures for lightmapping? How do I go about applying the textures in both stages and calling DrawSubset()? Both textures group different polygons!

Topic Locked

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

Sign in to reply to this topic.