Search Unity

Resolved Sprites not affected by environment distance fog

Discussion in 'General Graphics' started by robdood, Jan 23, 2021.

  1. robdood

    robdood

    Joined:
    Jan 18, 2021
    Posts:
    14
    Hi all, I'm super new at unity, so please forgive the likely dumb question :)

    I'm making a '2.5D' project while I learn the ropes. Initially I was using a terrain object with some very simple texturing / sculpting to add some depth, by turning on Fog in the Lighting > Environment panel.

    I'd like to replace the terrain with some sprites / art of hills etc I've made.

    Only problem is, when I put them into the scene they aren't affected by the distance fog. I presume this is because of the 'sprites-default' material, as when I try some of the other materials the fog does indeed work, however the colour information seems to vanish from the sprites when I do this, and they end up greyscaled.

    Is there a setting within the inspector I can use to overcome this, or is it something I need to manually do / create a specific shader for?

    I found this reddit post which contained a shader script which I've tried to attach to a new material, but it didn't work.

    Any advice gratefully received :)
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    Use a material using a particle shader. That Reddit post response is weird because that shader absolutely won’t fix the problem.
     
  3. robdood

    robdood

    Joined:
    Jan 18, 2021
    Posts:
    14
    Just to say thanks @bgolus - this worked fine, though I had to do some weird colour adjustments on the material to get it to look right! :D
     
  4. MqcCheeze

    MqcCheeze

    Joined:
    Jun 21, 2021
    Posts:
    16
    It'd be nice if you told us how
     
  5. jhocking

    jhocking

    Joined:
    Nov 21, 2009
    Posts:
    814
    Not sure if there are other approaches that'd work better, but what I just did was:

    1. Create a new material
    2. Change the material's shader to Particles > Standard Unlit
    3. Change the material's Rendering Mode to Cutout
    4. Drag this to the sprite renderer's material slot