Tree billboards fog and transparency issue

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.

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!

sounds similar to this issue,

Are you rendering these trees with the same shader as you are the other ones? Standard Unity Shader or something custom?

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. :frowning:

You need to transfer the Fog parameters in your shader, from the Vertex/Geometry Shader to the fragment or pixel shader. You can check this package. It includes fog support for billboarded trees, among many other features.

Store Link: Massive Vegetation | 3D Vegetation | Unity Asset Store

Forum: [RELEASED] Massive Vegetation - ultra high performance billboard rendering system

PS: I´m the author, so I´m not imparcial… :slight_smile: