Search Unity

How to suppress "The tree must use Nature/Soft Occlusion shader" warning.

Discussion in 'World Building' started by adamgryu, Feb 14, 2022.

  1. adamgryu

    adamgryu

    Joined:
    Mar 1, 2014
    Posts:
    188
    Hello! I've been using custom tree shaders for a while now, in various projects.
    They work fine, but I always get this warning in my console.

    The tree Bush must use the Nature/Soft Occlusion shader. Otherwise billboarding/lighting will not work correctly.


    I've been doing some cleanup and I thought - it's time to try and figure out how to get rid of this warning!
    What can I do to my shader to make Unity realize it is a compatible tree shader?
     
  2. adamgryu

    adamgryu

    Joined:
    Mar 1, 2014
    Posts:
    188
    EDIT: Nevermind, spoke too soon. This doesn't work.

    For anyone else that finds this post:

    Code (CSharp):
    1. Tags
    2. {
    3.     "TerrainCompatible" = "True"
    4. }
     
    Last edited: Dec 1, 2022
  3. autopsychotic

    autopsychotic

    Joined:
    Mar 26, 2023
    Posts:
    1
    I'm finding this late, but having the same problem. To which script do I add your code snippet with the tag?
     
  4. SteenPetersen

    SteenPetersen

    Joined:
    Mar 13, 2016
    Posts:
    103
    It's unclear from the warning message but you can remove this warning by adding LODs to the object in question, in the OPs case add an LOD group to the 'Bush' object. If you wish to have a fast way of doing this consider using 'AutoLOD', its developed by Unity and works pretty well. Link to the repo is here, and you can import it through the package manager with the github link:

    https://github.com/Unity-Technologies/AutoLOD
     
    adamgryu likes this.