Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Write Tree Soft Occlusion Leaves to Z-Buffer

Discussion in 'Shaders' started by essejmclean, Sep 10, 2015.

  1. essejmclean

    essejmclean

    Joined:
    Feb 21, 2013
    Posts:
    9
    Hi;

    I'm attempting to use an image effect (a custom Global Fog) that requires shaders to write to the z-buffer (as it sorts for depth). I'm using the Tree Soft Occlusion Leaves shader for my leaves, and though it has language in it that says it should be writing to the Z-buffer, it doesn't seem to actually do that. This is giving me, and I'm sure others, problems.

    Would somebody mind helping me take a look into that shader or have any knowledge about this issue? The shader can be found in default install of Unity under Nature/Tree Soft Occlusion Leaves. For testing purposes, Image Effects/Rendering/Global Fog can be used (this comes with Unity's Standard Assets pack).

    Given that this is a Unity shader, and is written to write to the z-buffer, it surprises me that it doesn't.

    Thanks.

    j
     
  2. EdRowlett-Barbu

    EdRowlett-Barbu

    Joined:
    Mar 16, 2015
    Posts:
    88
    I would like to hear an answer to this as well. I can not get trees using this shader to work with fog
     
  3. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    Came across this issue today (having originally had problems with billboarded trees and think I've managed to hack my way around that - now it's my unboarded refusing to play nice with fog!)
     
  4. Elzean

    Elzean

    Joined:
    Nov 25, 2011
    Posts:
    584
    i have same problem, does anyone have a solution ?