Tree Billboard to mesh transition blend

I’m searching for a way to improve the tree billboard to mesh transition at the unity terrain trees.
The problem is that the standard transition only trys to move the vertex of the billboard to match the mesh of the tree.
That causes a “pop” effect when the billboard is replaced by the tree mesh.
The Fade Length dos not solve the problem.

I discover that the game cities in motion 2 does use unity and they have solved the problem nicely.
It looks like they rendering the billboard in front of the normal mesh some distance before replacing it.
They do not “just turn it off” the billboard ,they blend the billboard out be lowering the alpha value of the billboard transparent shader, so the tree blends away a lot nicer.

Is there any way to implement this on Unity’s terrain or do i have to build my own / modify some other terrain project?

Any tip or discussions are perfectly welcome.

Greetings fffMalzbier

hi malzbier,

i do not know anything about “cities in motion” but the upcoming version 2.04 of my advanced foliage shaders bring some improvements to the blending between billboards and mesh trees.

just have a look at the official thread to find out more:
http://forum.unity3d.com/threads/133398-Advanced-foliage-shader-released/page8
http://forum.unity3d.com/threads/133398-Advanced-foliage-shader-released/page9

or simply give them a try:
http://dl.dropboxusercontent.com/u/2322017/afs_v2/afs_v2_touchbending/afs_v2_treeShader02/afs_v2_treeShader02.html

lars

Could you do a demo with a big terrain with a lot Trees and the Viewer can fly?
The problem is mostly present on a 30 - 60 degree angle for the top.

For all that are interestetd int this toppic should take a look into the builtin_shaders-4.1.2\CGIncludes\TerrainEngine.cginc

Thats the place where the calculation for the billboarding is happening and thats the place to to modify the defauölt behavior. (Took me quite some time to figure that out. )

sorry, no demo at the moment.
but you have spotted the big problem :wink:
although i have nearly fixed this issue so trees stick to the ground even when viewed from angles between 30 – 90 degrees.

i hope i can show something soon.

lars

hi malzbier,

a quick test is ready:
http://dl.dropboxusercontent.com/u/2322017/afs_v2/afs_v2_touchbending/afs_v2_treeShader03_fly/afs_v2_treeShader03_fly.html

  • use “wasd” and your mouse to navigate.
  • use “3” to roate the sun and see how the “shaded” billboards might look (do not forget to rotate a littel bit around to force unity to update the billboard textures).
  • use “4” to toggle between perspectively aligned and simply upright billboards. (the billboard shader will always perform advanced shadow and bending fading though, as it is not the built in one.)

Please note: it is absolutely ok if you get some kind of “extra punch” during the transition between billboard to mesh tree: that is the wind “fading in” which is set to “4”…

terrain settings:
– billboard start: 50
– fade length: 15
– max mesh trees: 75

did i forget anything?
enjoy!

lars