Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  

D3DXUVAtlasCreate for lightmap packing

This topic is 2873 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 trying to use D3DXUVAtlasCreate to optimize texel utilization for our lightmaps. I have it sort of working, in that I can remap my UVs and re-sample my texture and everything still looks correct. I'm just not understanding how to actually make the lightmap smaller/better. Here is what I am doing...

1) I get a mesh with lots of super high resolution lightmaps from the artists. I pack all the source lightmaps into a big texture using a simple packing algorithm, and create an initial set of UVs.
2) I run [font=Consolas, Courier, monospace]D3DXComputeIMTFromTexture on this initial lightmap texture.[/font]
[font=Consolas, Courier, monospace]3) Using the generated IMT data, I call [/font][font=Consolas, Courier, monospace]D3DXUVAtlasCreate.[/font]
[font=Consolas, Courier, monospace]4) Using the mesh generated above, I call [/font][font=Consolas, Courier, monospace]D3DXCreateTextureGutterHelper and ResampleTexture to generate my new lightmap[/font]
[font=Consolas, Courier, monospace]
[font=Consolas, Courier, monospace]At this point, I have a new lightmap texture that's been shifted around from what I started with, and I have a new set of UVs to go along with it. It doesn't really seem any *better* than what I had before. It doesn't really look like low detail areas of the source lightmap are getting reduced texel utilization in the generated lightmap.[/font]
[font=Consolas, Courier, monospace]
[font=Consolas, Courier, monospace]At this point, would you expect to just manually shrink the generated lightmap, and have it look better due to the improved texel utilization created by [/font][font=Consolas, Courier, monospace]D3DXUVAtlasCreate? If this isn't working for me, could it be because I'm doing something wrong while generating my IMT data? Or am I completely off base with this?[/font]
[font=Consolas, Courier, monospace]
[font=Consolas, Courier, monospace]Thanks for any help.[/font]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!