Search Unity

Found unusual 'Exclude_Renderers' option 'noShadows'

Discussion in 'Shaders' started by Noisecrime, Aug 5, 2014.

  1. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,054
    Hi,
    So I was looking through some of the built in shader code (4.3.4 to 4.5.2) as you can often learn some useful little tips from them and in several of the 'Nature/TreeCreator' ones (e.g. 'TreeCreatorLeavesOptimized') there is the exclude renders pragma with the option 'noshadows'.

    I'd not seen this before and obviously its undocumented.Even more strange is that its defined in the ShadowCaster and ShadowCollector passes, where one would expect to want shadows ;)

    Anyone ever come across this? Anyone know what it does? Perhaps its a typo and is just ignored?
     
  2. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Just an idea -- ShadowCaster and ShadowCollector are themselves geometry passes -- when those mesh draw-calls are issued, they should probably exclude any logic related to shadows that a normal visible draw-call would include?

    But yeah, odd.
     
  3. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    "Anyone know what it does?" - I do :)

    It basically means "don't even compile this shader for platforms that definitely don't have shadows". This used to be some platforms back in the day, but I think nowadays all platforms have shadows. So basically, "#exclude_renderers noshadows" does exactly nothing.
     
  4. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,054
    Oh, thats disappointing, thought i'd stumbled onto some big secret ;)

    Anyway thanks for clearing it up.