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

Particles are bright from some angles and not others, how can I fix this?

Discussion in 'General Graphics' started by sledgeweb, Sep 18, 2018.

  1. sledgeweb

    sledgeweb

    Joined:
    Sep 9, 2016
    Posts:
    31
    Sample clip:https://gyazo.com/496d6778c74860ae456f0c08da71b269

    I'm using particles for dust trails, and even when I'm in a dark cave, the particles can appear really bright... but only from some angles. Can anyone help me work this out to achieve more realistic dust particles?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,366
    Disable soft particles, or lower the range.
     
  3. sledgeweb

    sledgeweb

    Joined:
    Sep 9, 2016
    Posts:
    31
    Thanks for the feedback. Hmmm. I disabled soft particles, and can't really tell a difference. The particles still get really bright from some angles even though the color mode is set to multiple:

    https://gyazo.com/c4f4058d0db48390e752d45bf38e6693

    Any other ideas?
     
    Last edited: Sep 18, 2018
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,366
    Try disabling the distance fade too. As you rotate around your camera is getting closer and further from the particles.
     
  5. sledgeweb

    sledgeweb

    Joined:
    Sep 9, 2016
    Posts:
    31
    Thanks again, still not seeing any noticeable improvement in the glowing dust. Any other ideas?

    https://gyazo.com/714937608472b6a8dd4eb94d43e63c77

    What I'm going for is a particle that will be dark/unlit when in the dark, and then appear light/natural when in the light. Right now, it looks good in the light, but when I go in dark areas, the dust stays the same brightness.
     
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,366
    Ah. That’s different than “really bright from certain camera angles”, that’s “not being affected by lighting.” Youre using an unlit shader, which by definition is not affected by lighting. Unfortunately you have a secondary issue which is Unity doesn’t support shadow casting on transparent materials, so particles that are lit, and are in a dark area due to the light being shadowed will still be bright. There’s no easy solution to this since Unity explicitly does not support it.

    See the now 10 year long thread on transparent objects not receiving shadows...

    The hack work arounds are:
    Render your own shadow maps, or copy the built in ones using command buffers and compute buffers, and manually pass them to custom particle shaders.
    Use baked lighting and light probe proxy volumes and sample all lighting for particles from that, again using custom particle shaders.
    Raycast from the particle system to the light to see if it should be considered in shadow and change the particle system’s start color.
    Use hard edged or dithered alpha tested particles, which really can receive shadows.

    Or less hacky would be to move to the new LW or HD pipelines, both of which support lit and shadowed transparencies, but you’ll likely still need custom particle shaders since neither really have good shaders for this yet.
     
  7. sledgeweb

    sledgeweb

    Joined:
    Sep 9, 2016
    Posts:
    31
    Thanks for the detailed response! Glad it wasn't something simple I'm missing. I think the easiest of these options for me to explore would be the raycast/particle color. So I'm going to look into that more as well as the other methods you outline. I don't feel comfortable yet switching to the LW or HD pipelines, even though they look promising for the future.