As you can see in the image I got some artifacts in my lightmaps. How can I eliminate them?
Here you find the actual light map images.
As you can see in the image I got some artifacts in my lightmaps. How can I eliminate them?
Here you find the actual light map images.
NecroSOFT - End of line -
Isn't that either rounding errors or wrong wrapping mode?
Peregrinus, expectavi pedes meos in cymbalis
Nullus norvegicorum sole urinat
That's a common edge bleeding artefact.
I had plenty of problems with them when I wrote my lightmapper.
A solution is to leave a gap of 2-3 pixels around each shape in your lightmap, then after you finished generating the entire lightmap, go back over it and extend the edges of all the shapes in your lightmap.
The way I did this is something like this:
- Colour in the background of your lightmap a rarely used colour, like (255, 0, 255) or something
- For each pixel of your lightmap:
--- if this pixel is (255, 0, 255) then
--- add up all adjacent pixels which are NOT (255, 0, 255)
--- colour this pixel the average of these colours.
And that should fix it.
Setting the SamplerStates for AddressU, AddressV and AddressW to D3DTADDRESS_CLAMP before rendering the lightmap and after that setting them back to D3DTADDRESS_WRAP should fix the problem I think.
<a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>
clamp does not work, already tried that. I think nitrogen has the solution to add padding on each lightmap.
NecroSOFT - End of line -
What about clamp_to_edge instead of just clamp?
Peregrinus, expectavi pedes meos in cymbalis
Nullus norvegicorum sole urinat
I never had good thoughts about padding solutions. This cannot be intended by Microsoft. There must be a better way (in fact the way it is intended). I am interested in those "techniques" too, so if anyone knows the answer for all those antialiasing problems, please spread your wisdom There are also strange artifacts when using Mipmapping and transparent textures... Too many problems for a single feature. There must be some kind of renderstate that is designed to avoid those artifacts (at least I hope so).
In most cases, the clamp did work for me... But there are still problems in some cases...
<a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>
disable mipmaps for a specific renderstate (eg. lightmaps). My world the world becomes also invisible when, due mipmaps are createded, but not filled in any way with any color... (however I didn't tried it yet)
And how can I enable face clamp?
NecroSOFT - End of line -
Bookmarks