Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Strange artifacts using beast in Unity 3

Discussion in 'Editor & General Support' started by dtiesling, Sep 14, 2010.

  1. dtiesling

    dtiesling

    Joined:
    Mar 15, 2010
    Posts:
    17
    I have a massive outdoor scene we had constructed for a project using Unity 2. I have converted the project over to Unity 3 and am currently working in beta 7. I keep coming up with these artifacts when baking the lightmaps. I fear I'm pushing the editor to it's limit. At a reasonable texel density it has to bake 50+ 1k maps. Has anyone else encountered this?

     
  2. spaceMan-2.5

    spaceMan-2.5

    Joined:
    Oct 21, 2009
    Posts:
    710
    Are you using Global Illumination?
     
  3. robert

    robert

    Moderator

    Joined:
    Dec 21, 2008
    Posts:
    265
    Are those artifacts visible in the lightmap textures when you open the .exr files in photoshop? If not, are they visible in the inspector when you select the lightmap in the project view?

    Could you submit a bug report with a zipped project that reproduces the issue? (preferably the smallest scene that still reproduces the issue)
     
  4. dtiesling

    dtiesling

    Joined:
    Mar 15, 2010
    Posts:
    17
    Here is my beast settings xml. I do have final gather rays so I assume that it is calculating global illumination. Are you talking about an actual option somewhere?

    Code (csharp):
    1. <?xml version="1.0" encoding="ISO-8859-1"?>
    2. <ILConfig>
    3.   <AASettings>
    4.     <samplingMode>Adaptive</samplingMode>
    5.     <clamp>false</clamp>
    6.     <contrast>0.1</contrast>
    7.     <diagnose>false</diagnose>
    8.     <minSampleRate>0</minSampleRate>
    9.     <maxSampleRate>2</maxSampleRate>
    10.     <filter>Gauss</filter>
    11.     <filterSize>
    12.       <x>2.2</x>
    13.       <y>2.2</y>
    14.     </filterSize>
    15.   </AASettings>
    16.   <RenderSettings>
    17.     <bias>0</bias>
    18.     <maxShadowRays>10000</maxShadowRays>
    19.   </RenderSettings>
    20.   <EnvironmentSettings>
    21.     <giEnvironment>SkyLight</giEnvironment>
    22.     <skyLightColor>
    23.       <r>0.86</r>
    24.       <g>0.93</g>
    25.       [b]1[/b]
    26.       <a>1</a>
    27.     </skyLightColor>
    28.     <giEnvironmentIntensity>0</giEnvironmentIntensity>
    29.   </EnvironmentSettings>
    30.   <FrameSettings>
    31.     <inputGamma>1</inputGamma>
    32.   </FrameSettings>
    33.   <GISettings>
    34.     <enableGI>true</enableGI>
    35.     <fgPreview>false</fgPreview>
    36.     <fgRays>1000</fgRays>
    37.     <fgContrastThreshold>0.05</fgContrastThreshold>
    38.     <fgGradientThreshold>0</fgGradientThreshold>
    39.     <fgCheckVisibility>true</fgCheckVisibility>
    40.     <fgInterpolationPoints>15</fgInterpolationPoints>
    41.     <fgDepth>1</fgDepth>
    42.     <primaryIntegrator>FinalGather</primaryIntegrator>
    43.     <primaryIntensity>1</primaryIntensity>
    44.     <primarySaturation>1</primarySaturation>
    45.     <secondaryIntegrator>None</secondaryIntegrator>
    46.     <secondaryIntensity>1</secondaryIntensity>
    47.     <secondarySaturation>1</secondarySaturation>
    48.     <fgAOInfluence>0</fgAOInfluence>
    49.     <fgAOMaxDistance>0.223798</fgAOMaxDistance>
    50.     <fgAOContrast>1</fgAOContrast>
    51.     <fgAOScale>2.0525</fgAOScale>
    52.   </GISettings>
    53.   <TextureBakeSettings>
    54.     <bgColor>
    55.       <r>1</r>
    56.       <g>1</g>
    57.       [b]1[/b]
    58.       <a>1</a>
    59.     </bgColor>
    60.     <bilinearFilter>true</bilinearFilter>
    61.     <conservativeRasterization>true</conservativeRasterization>
    62.     <edgeDilation>3</edgeDilation>
    63.   </TextureBakeSettings>
    64. </ILConfig>
    65.  
     
  5. dtiesling

    dtiesling

    Joined:
    Mar 15, 2010
    Posts:
    17
    When I look at the exr's in photoshop the artifact areas show up as pure white. They are not alpha, just pure white areas. In the inspector the edges of these areas show up as white and the interior is pure black. It resembles an edge detection filter.

    I'll see what I can do about getting a package to you guys. The file is massive and I am not sure if I can even let it out of the studio. I have already submitted a bug report though.
     
  6. dtiesling

    dtiesling

    Joined:
    Mar 15, 2010
    Posts:
    17
    So i think i may have found the problem. I turned my bounces down from 2 to 1. Problem fixed. I think the issue has something to do with the light being blown completely out. There are no longer any areas of pure white in my maps (that I can see, there are 50 maps and i havent gone over them with a fine tooth comb or anything). So it seems to be if you overlight an area and the lightmap goes beyond a certain threshold it goes to pure white in the exr. The editor renders those white areas as weird artifacts. Just a theory though, please let me know if anyone finds anything new out.
     
  7. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,853
    You could then just turn the exposure down on the lightmap exr in your image editor..could you not? Then adjust gamma and white and black points to get the original "feel" back into the map.

    BTH
     
  8. robert

    robert

    Moderator

    Joined:
    Dec 21, 2008
    Posts:
    265
    I tried baking a couple of scenes with crazy overburn and it never happens for me.

    I would *really* appreciate a repro case for this :wink: Maybe it would be possible for you to swap some of the meshes for cubes and, if it's still happening, export the scene as a package with dependencies? (it will make unity include only those assets that are used in the stripped down scene)
     
  9. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    You can always try switching clamp to true in the xml.
     
  10. robert

    robert

    Moderator

    Joined:
    Dec 21, 2008
    Posts:
    265
    Ok, the issue is fixed now and the fix will be available with the next minor release of Unity, which should be quite soon.

    In the meantime you can workaround the issue by not using meshes with multiple materials. And if you do - don't use the tiling and offset properties of the materials' textures.
     
  11. JonBrouchoud

    JonBrouchoud

    Joined:
    Dec 7, 2009
    Posts:
    39
    I know all scenes are different, but in the case I'm working on, it seems like increasing Final Gather rays to 2 or 3k, turning bounces, bounce boost, bounce intensity and ambient occlusion all to 1, with a texel resolution of around 40.. does the trick for me anyway.