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

Tree billboards fog and transparency issue

Discussion in 'General Graphics' started by ChiRho, Apr 16, 2018.

  1. ChiRho

    ChiRho

    Joined:
    Oct 6, 2015
    Posts:
    6
    Hi,

    I'm having some issues with the tree billboards:

    (1) They don't get affected by the fog. I'm using Fog under Lighting / Other Settings.
    Parameters:
    Colour: #8C8C8C
    Mode: Exponential
    Density: 0.0005

    I also have a Global Fog script attached to my main camera, where I can adjust the height and density of the fog. I have a couple of other things in the mix as well, such as particle effects and some settings that make the skybox always visible.

    (2) The billboards appear to get translucent against the terrain horizon when I use particle effects. In other words, I can see the terrain through the tree billboards. It seems like the particle effect I use to animate the fog somehow clash with the billboards.

    I've put some screenshots together from a work-in-progress level to better explain the issue.

    Top left image: Here I've made the fog relatively subtle, though it's possible to see the issue.

    Top right image: Here I've increased the fog a lot just to illustrate what happens. As you can see, the trees (mesh) are affected by the fog, but the tree billboards are not affected.

    Bottom left image: These trees (mesh) are not see-through up close.

    Bottom right image: When zoomed out, the billboards become translucent. However, they are not translucent if I disable the particle effect.

    bug.jpg


    Sorry for the lengthy post over something that is probably a small issue! Now I know I can get rid of the particle effects and increase the Tree & Detail Objects / Detail Distance (currently set to 128), but I'd like to avoid this is possible.

    Does anyone have any clues? Hope you can help and thanks for reading!
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
  3. Spaniel

    Spaniel

    Joined:
    Dec 23, 2012
    Posts:
    52
    Are you rendering these trees with the same shader as you are the other ones? Standard Unity Shader or something custom?
     
  4. ChiRho

    ChiRho

    Joined:
    Oct 6, 2015
    Posts:
    6
    Thanks for the advice!

    Regrettably, I didn't have much luck modifying the scripts. The shader in and of itself works well, but I suspect it doesn't work with my current camera setup. I'm switching between multiple cameras (though my effects are attached to a main camera, but it isn't actually used as a camera in the game)

    I also tried to find the Unity-BillboardTree.shader, but it seems like it's no longer accessible in the more recent versions of Unity(?)

    I'm using Unity's standard terrain tools. Nothing fancy.

    I quickly looked at SpeedTree and AltTrees, but I'm not overly keen on creating my foliage again. :(
     
  5. graphicDNA

    graphicDNA

    Joined:
    Jun 26, 2017
    Posts:
    47