• Advertisement

Archived

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

Lightmapping

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

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.

Share this post


Link to post
Share on other sites
Advertisement
check the device caps, if it supports multitexturing, then use it, otherwise have a backup method that uses 2 passes.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites

  • Advertisement