Search Unity

Tree Shadow Casting

Discussion in 'Shaders' started by cowtrix, Dec 1, 2015.

  1. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    322
    Hey guys, quick question on tree shaders. So you know when a terrain tree transitions from billboard to mesh, how during the transition it does not cast shadows... what does this? Is there any way to disable this, so they do cast shadow throughout this transition?

    I wonder if @larsbertram1 might have any ideas on this? <3
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    afs3 for unity 4 made trees always cast shadows: as well as billboard as during the transition.
    however unity 5 changed the way shadows are computed when using forward rendering: it is not possible anymore to have 2 different "meshes" (one for rendering the tree to the screen, one for rendering it as a shadow caster) without getting artifacts in the z-buffer. so i dropped this feature in afs for unity 5.
     
  3. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    322
    Hey @larsbertam1, yes we've found this issue as well and have implemented, I think, the same fix (just using addshadow).

    Do you remember where the code that handles that transitional shadow casting was?