Search Unity

Terrain Basemap Bug with Linear Space Lighting

Discussion in 'Editor & General Support' started by Tinus, May 11, 2012.

  1. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    After switching my project settings to use linear space lighting (such an improvement, by the way!) the basemaps of my terrains render the wrong way. Turning the directional light on or off doesn't seem to matter, the brightness different seems to persist irrespective of the lighting setup in the scene.



    Uneducated guess: The basemaps didn't get the memo regarding the transition to linear space. Or am I doing something wrong here? :)

    I'll submit a bug report if it turns out I can't fix it myself.
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Hi, what version of Unity are you using and what format are your base textures in (are some linear and some not linear?)? I fixed a bug in this that should be in the latest unity point release, but maybe it has to do with certain texture formats.
     
  3. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Thanks for mentioning the import settings. It turns out some of the Nature Pack's texture import settings had the 'bypass sRGB' setting still flagged by default. I feel a bit silly for not noticing this.

    Fixing these settings improves it, but there's still a small difference in lightness. Here's a screenshot of the effect and the current import settings:



    This is using Unity 3.5.1f2
     
    Last edited: May 11, 2012
  4. yarnevk

    yarnevk

    Joined:
    Jul 25, 2013
    Posts:
    8
    I am using 4.1.5f with linear space and also find the base map is mixing the splat maps in gamma space rather than linear space. Do 50% dirt, 50% grass and outside your base map distance it will be grassier because the darker grass is getting a gamma boost.. Texture option generate mipmaps in linear space does not make a difference. Textures have bypass sRGB checked off.

    Go back to gamma space rendering and the base map matches the near splat map mixing.

    Workaround is maxing out base map distance and taking the fps hit, or not using the splat maps.

    [EDIT turns out I had splat mats that I had normalized using the vector normalize function which makes the magnitude 1.0, but splat mats want the sum to be 1.0. Found a post that suggested testing by making all textures the same, if brightness varies the splat mats are not normalized]
     
    Last edited: Aug 16, 2013
  5. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    515
    Lars,

    Is there an issue using the shaders with Linear Lighting and HDR? I have noticed that the billboarded tree's go very dark unlike when in forward lighting mode. Is this a unity bug or is this something that i can solve with your shaders?