ahaa, thanks for clearifying that!
Hello! My meshgrass have black outer lines further away from player, how can I make it look better?
It could be related to the alpha channel and mip maps. Adjusting the alpha cutoff could work. From 2017.x (do not remember what version) there is also some settings direct on the textures that allows you to adjust a bit what is done when the mipmap is created.
Lennart
Hi,
Thanks for the reply. Not sure how to PM? Can you point me in the right directionâŚ![]()
In the meanwhileâŚI created a clean project to make sure, only Vegetation Studio added.
Empty scene, create unity tree, add Nature/Tree Creator Bark
Observations:
Trunk does not move in instanced versions, but branches do
Wind direction is not respected, seems to sample initial wind direction then the instances are turned bent in the incorrect direction
Also playing with wind parameters, both the wind object or the vegetation studio wind settings, makes no change.
Unity 2018.1, Mac
Thanks
Cas
Why do I get more FPS with instanced rendering disabled? I tried it with example scene in empty project and in my own project. Shouldnât it be other way around?
Yes, sounds strange. Could you send me a pm with some info about your setup, OS, unity version, graphic card and ideally a CPU and GPU profiler screenshot.
Lennart
Hi, i have a scene with VS and a truck that has multiple cameras apart from the main camera. These other cameras are to render textures for the various rear view mirrors.
I have tried to get the VS system working in the rear view mirrors with little success, i have searched the forums regarding multiple cameras but found no real clear instructions besides adding a Vegetation system for each camera, and assigning the camera as well as checking the render to this camera only box.
Now i will state that this does make it render in the rear view mirrors, however it then disables the vegetation in forward view camera of the player⌠i can clearly repeat this by enabling and disabling the second vegetation system on my mirror camera and watching the forward view vegetation system become visible/non visible as i do so.
i am using Unity 2018.0.0f2
Deferred rendering.
I am building for windows (VR Oculus)⌠but also tested with non VR build and same result.
I have attached some screen shots of my settings.
I have copied and pasted my original Vegetation System and renamed it, then changed the camera to be rendered as well as set the render option ârender only to selected cameraâ for all cameras.
It seems like the second VS interferes with the main cam one somehow.
Hello,
About LOD fading, Iâve understood that VS doesnât use the prefab (for example I have a prefab containing 3 Mesh trees with 3 LOD and a LOD group component on top with Crossfade activated)
In VS when I move forward to trees, the LOD pop in an horrible way, even though the difference between my LOD models are subtles, itâs really obvious.
I donât have any speedtrees and read that in 2018.1 the LOD Fade works for Speedtrees. What about the rest? or am I doing something wrong here?
Weird⌠I use Dynamic Nature and they work good
LOD Fade for non-SpeedTree shaders is a feature coming soon. Right now it is just working for SpeedTree shaders.
I use Advanced Folliage Shaders and something isnât right⌠the worst is from mesh to billboard
Hello,
I found this âSurreal gras shaderâ:
Looks beautiful. Can it be used with Vegetation Studio? Does it make sense to integrate it for a top-down viewed game?
Thanks ![]()
Hello, Iâm planning to use a custom shader for SpeedTree (from here: Partially transparent speedtrees - ideas ? ) that allows making a tree semitransparent, so that it will not cover the character.
My idea is to raycast to find the tree to make transparent.
I have 2 options
- replace the shader at runtime just on that tree and set the transparency amount and the render queue to 2999
- have the shader already assigned to all trees and set the transparency amount (keeping the render queue at 2999 for all trees)
Iâm not sure if itâs possible.
How do you suggest to proceed? Or do you have another solution?
Thanks
Hi. I had a look at the shader now. It is not a surface shader and I think you manually have to add some small changes to make it support instancing. You can test with installing the shader and see if a enable instancing checkbox shows up on the material.
To manually add instancing to the shader have a look here.
Lennart
Unity 2018.1 finally allows me to inject the Unity_LODFade variables when rendering instanced.
As a first step I got the vertex LODFade working between speedtree LODs
For the next update all shaders that use the LOD_FADE_PERCENTAGE will get this set and should work.
A next step is to get the standard dither crossfade in the billboard shader of Vegetation Studio. When that is done shaders with LOD_FADE_CROSSFADE should work also to blend between the last LOD and the billboards.
I will post progress here.
EDIT: I fixed a bug today that could give some blinking in some cases between the last LOD and the billbords. will be in the next update
Lennart
Hi.
This is not an easy setup when rendering instanced. All the trees of the same type and LOD are batched together in Vegetation Studio and rendered with the same material and shader. Even if we detect what instance we want to affect from raycasting the run-time created colliders we would have to test the render lists to find the instance, exlcude it and have the structure to replace shader and render this instance. All these tests take cpu time. and has to be done every frame since the camera changes.
I think to get something like this working fast you might be able to implement this on a shader level. Calculate a custom camera frustum set to cover the area from the camera including the character. assign this to the tree shaders.
then in the vertex shader test against the frustum, and pass a transparecy to the fragment shaderâŚ
There will be some calculations on the GPU but the rendering structure will not have to be changed.
EDIT: If you did a instanced indirect version of the shader this could be done on a per instance test. You could modify the frustum culling compute shader to test agains the bounding spheres of the vegetation items. then pass your transparency data to the shader. There is a float4 called ControlData passed to the shaders. This was added for custom data like this.
Lennart
Development update
Hi. I wanted to share a bit on the progress of Mesh Terrain support and how it will work.
I have it running in a development branch and need to merge it with the main code and make get the new terrain interface working without any backward compability issues.
There will be a couple of new components available.
- MeshTerrain
This is the main component of the mesh terrain. Here you can add meshes, configure settings and sources. - MeshTerrainData
This is a scriptable object used to save the generated tree data used by VegetationStudio.
For my test example I generated a 4x4 mesh terrain from a normal terrain using Mesh Materializer asset.
Tiled meshes is not a requirement, any GameObject with a mesh and a MeshRenderer can be added. big rocks, cliffs etc.
This is 16 normal meshes in the Scene

I then added the MeshTerrain component to a GameObject. Created and assigned a MeshTerrainData component to have a place to store the terrain data generated.

Next step is to add the meshes to the component. You can drag and drop multiple gameobjects. In this case I just drop the root object.
When all meshes are added press generate terrain data. This will build the internal data needed for sampling the mesh terrain later.
We then add the mesh terrain to the Vegetation System component. Had to do some hardcoding here for my test, but there will be a simple to use UI, like for adding a normal terrain.
Here is vegetation spawned run-time on the mesh terrain as it would on a normal Unity terrain.
Terrain texture rules in the vegetation package will be ignored since there is no splatmap to sample, but texture masks, noise, height, steepnesss etc will work as normal. The persistent storage and vegetation masks also.
For the vegetation masks there is a setting to select what layers to use as terrain when editing the masks.

I am also adding a MeshTerrainSource setting. This will be for a new spawning rule that only works with mesh terrains. It allows you to set a source for each mesh you add and a similar spawning rule for each vegetation item.
This way you can have vegetation that spawns only on a spesific mesh.

Any thoughts?
Lennart
Thank you for your detailed explanation. I will try your last suggestion but I think itâs a bit over my knowledge. Iâll research and try. But if Iâm understanding correctly the shader will be always the same for all the trees. This will make all the tree to use alpha blending. Could it be an issue? From a top down view should be fine, but in case of some longer range view the will be a lot of over drawing.
Would there be a way to integrate Mesh Terrain functionality with Mesh LODs?
Iâve got an 8x8 terrain tile setup, and looking forward to new functions in VS to manage the Vegetation Packages on all those terrainsâŚbut I also need the vegetation to render on mesh terrain LODs 1-3km away from the camera, using World Streamer with ring streaming. (So 3x3 Unity terrains around the camera, and the rest are mesh LODs.) Awhile ago you suggested that I bake billboards for all those mesh LODsâŚbut would there be a (better) way using this new Mesh Terrain support?
The terrain mesh component builds a internal Bounding Volume Hierarchy of all the meshes you add to it. It does not do anything with rendering of the meshes. The internal tree allows Vegatation Studi to sample the height and normal of a position. When the tree is built we do not need the meshes anymore.
If you render a LOD at distance it would not matter for Vegetation Studio.




