Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Flashing when stacking particle/multiply and particle/multiply-double

Discussion in 'General Graphics' started by blaher, Jan 8, 2016.

  1. blaher

    blaher

    Joined:
    Oct 21, 2013
    Posts:
    67
    In an effort to achieve a nice banded/flowing effect for gas giants, I used multiple spheres w particle/multiply and particle/multiplydouble. The end result looks great, minus a odd flashing I get from different angles. It isn't z fighting I don't think since all the layers are using particle blending shaders. Ideas how to avoid this flashing?

     
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    I'm guessing it actually is z-fighting. Try to disable the zwrite on the particle shaders.
     
  3. blaher

    blaher

    Joined:
    Oct 21, 2013
    Posts:
    67
    "ZWrite Off" is already in the particles/multiply and multiplydouble shaders

    just to rule out zfighting I spread each sphere out by 1 full unit of scale and still getting flashing.

    A little more info... I do have a 'surface' sphere which uses a planet shader and have tried the surface being different shader types without any change to the flashing.
     
    Last edited: Jan 8, 2016
  4. brownboot67

    brownboot67

    Joined:
    Jan 5, 2013
    Posts:
    375
    You can set the render queue on those material instances.
     
  5. blaher

    blaher

    Joined:
    Oct 21, 2013
    Posts:
    67
    Thanks brownboot67! I got it working by setting the renderqueue. At first I didn't think it was working because I didn't know this key tidbit from the wiki: http://wiki.unity3d.com/index.php?title=SetRenderQueue

    "
    • The default transparent queue is 3000."
    So setting the the layers as follows works great:

    surface planet shader = 0
    cloud1 multiply = 3001
    cloud2 multiplydouble = 3002
    cloud3 multiply = 3003
    ....