Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Help Wanted Unable to Crossfade SpriteRenderers using LODGroup?

Discussion in 'Shader Graph' started by neonaleon, Mar 11, 2021.

  1. neonaleon

    neonaleon

    Joined:
    Aug 25, 2012
    Posts:
    15
    Hi,

    I'm trying to use LODGroup with SpriteRenderers.
    The different LOD renderers are swapping correctly, but I can't seem to get crossfading to work between the LOD levels.
    Following some other forum posts such as Help Wanted - LOD CrossFade Shader in URP - Unity Forum, I have added a Custom Function node to get the unity_LODFade.x value multiplied into Alpha, and checked that this works with Planes and Cubes (Mesh Renderers in general?)

    Why doesn't this work for SpriteRenderers?
     
  2. neonaleon

    neonaleon

    Joined:
    Aug 25, 2012
    Posts:
    15
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,467
    I'm guessing internally the unity_LODFade.x value isn't being passed to Sprite Renderers in the render loop, because the concept of LODs doesn't really apply to sprites. So it would only work with (Skinned)Mesh Renderers, possible particle systems as well.
     
  4. neonaleon

    neonaleon

    Joined:
    Aug 25, 2012
    Posts:
    15
    Oh hi Staggart, thank you for your answer in the other thread :D

    Based on the language used in this Working with LODs - Unity Learn, it would seem like LOD Groups was designed to work with Sprites (so SpriteRenderers?)
    It would be nice to know if this is a bug.
     
unityunity