0
Under review

Baked Billboards Black

Burak 6 years ago updated by Aaron Brown 6 years ago 1

Hi there,

We are making a flight simulator. We need lots of trees and I created billboard trees from your models and materials. I placed the trees on the entire terrain with Gaia as seperate game objects and mesh baked them in groups. However after I bake my scene lighting, trees get black. When I import your asset again, trees go back to normal color. But when I re-open the scene, trees get back to black. I am using LushLODTree/Tree_Leaves2 shader. Can you help me?


Image 128


Under review

This is probably happening because you baked the trees into groups. If you want to do a combined mesh like this, you won't be able to use most of the LushLOD transition features. For example, there's absolutely no way the trees will be able to transition from high quality tree models, into billboard models. But if you are planning to use only the billboard models, then this might work... maybe....


But you're using the wrong billboard shader. You should be using the "billboard only" mode. Prior to converting the trees into this combined mesh, you should have set it to billboard only mode in the manager. But since you already converted them into a combined mesh, then I guess you can manually set them to use the billboard only shader..


Next, you have to understand that using a combined mesh like this means you basically can't use LushLOD manager, and the transitions won't work, and you'll need to also remove the LushLODTree.cs script from the trees... which means no transitions will work at all. You'll have to use billboard only mode... no transitions between high quality and billboard meshes will be possible with these combined meshes.


Also, I think yiou'll need to use one of the lower quality billboard shaders. You're using tree_leaves2 shader, which is one of the transitioning shaders. That won't work. It needs to be billboards only, if you want to combine the meshes like this, and needs to be one of the lower quality shaders such as leaves_far3 or leaves4_far (leaves 4 is the lowest quality). You'll basically have to delete the manager, and delete the LushLODTrees.cs script from all the trees, and delete the high quality tree meshes entirely, and leaving only the billboard meshes in the scene, and then attach something like the leaves_far4 shader to them, and then you'll have to write a script to set the main directional light in the tree's materials. Basically, if you look at the Update() function on the LushODTreeManager.cs, you'll see that it sets some global shader values relating to the main directional light, such as the color and intensity and direction of the light. Without those shader values being set, the trees will be completely black. If you remove the manager from your scene, then you'll need to write a script and copy ot all the stuff that the manager does in it's Update() function, relating to setting those global shader values, and put that into your scripts Update() function to ensure that your tree's have those necessary values for the main directional light, or else they will keep turning black.


Basically, the trees are not designed to be combined like what you are doing here. I guess you are combining them because you want a flight sim to have an extremely large number of trees, so you want to combine them for speed reasons. But unfortunately the trees do complicated transitions that just don't support this kind of combining of the meshes. If you want to combine the meshes like this, you'll have to follow the above steps to reduce the trees down to billboards only, and remove all the scripts, and even then I'm not 100% sure if it will work.The reason the trees keep turning black is probably because of the scripts... those scripts (the LushLODTreesManager.cs and the LushLODTree.cs) are messing with the tree's materials and material settings, but your meshes were combined and the scripts don't expect that.