Results 1 to 8 of 8

Thread: Lightmap artifacts

  1. #1
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Lightmap artifacts



    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 -

  2. #2

    Lightmap artifacts

    Isn't that either rounding errors or wrong wrapping mode?
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3

    Lightmap artifacts

    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.
    My site: DelphiTuts.com (coming soon)...

    Download Font Studio 4.21 here.

  4. #4

    Lightmap artifacts

    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&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  5. #5
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Lightmap artifacts

    clamp does not work, already tried that. I think nitrogen has the solution to add padding on each lightmap.
    NecroSOFT - End of line -

  6. #6

    Lightmap artifacts

    What about clamp_to_edge instead of just clamp?
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  7. #7

    Lightmap artifacts

    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&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  8. #8
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Lightmap artifacts

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •