Jump to content
  • Advertisement
Sign in to follow this  
Syranide

Lightmaps, sharing same texture

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

Ok, lightmaps is very easy to accomplish (not to generate them ;) ... But, since lightmaps generally are very small they "shouldn't" be placed in separate textures but would prove to be a great performance improvement to gather them in as few textures as possible. But doing that will pretty much end up with the problem I had yesterday with textures "wrapping"... but in this case leaking corners when using filters (which are really nice to have :) ... what is the common approach to this? Duplicating the corners of all lightmaps doesn't seem very smart as it would require all textures to be 2 pixels less than they "should be", which might get ugly... And finding optimal adjacent lightmaps would seem a little overkill?

Share this post


Link to post
Share on other sites
Advertisement
If you want to create a "texture palette" - storing multiple light maps per texture, then it is common to give them some spacing so that the various filtering algorithms don't screw you around.

Alternatively, if it's just the edges you have a problem with, the D3DTS_ADDRESSU and D3DTS_ADDRESSV properties of the texture samplers might be of interest. Off the top of my head, if you set them to D3DTS_CLAMP (or similar) then it will make sure the filtering doesn't wrap around at the edges. I use that quite a lot in my engine.

hth
Jack

Share this post


Link to post
Share on other sites
Yupp, clamping I know of... but that won't help for triangels right? :/
Only for the texture corners (which doesn't work for texture palettes) :)

But, ok, so spacing IS commonly used... thank you

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.

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!