Hello,
In our game we have modeled the ground / roads / sidewalks etc as meshes in a modeling app. We want to place trees and grass on various places however we need to use the Unity terrain in order to do that efficiently due to the optimizations offered by the terrain system when it comes to billboarding trees and also rendering grass efficiently.
Let’s ignore grass though and focus on trees.
We have thought of placing a flat terrain underneath our ground geometry and raise the terrain on areas where trees need to be visible. However that means that we will have to render a mostly invisible terrain.
Another option is to create tiny terrains ( like 4x4 ) with one tree on top of it, place it into a prefab and copy that terrain wherever we need trees. That would not render lots of terrain polygons however there would be some overhead for processing multiple terrains. So which is more efficient? One big-mostly invisible terrain or lots of tiny terrains?
Thank you
Just use the terrain as a normal terrain. You can place the roads and sidewalks on top of the terrain.
–Eric
There is no real terrain just roads and sidewalks ( it’s a city ). So we would have to sculpt the terrain accordingly and paint road textures on it which is very hard given the editor tools. That’s because our roads have slight constant slopes on them ( and I am not aware of any slope tool in Unity ).
We can place the sidewalks on top of the terrain however the sculpting would be very hard, very time consuming and possibly impossible for the city we are trying to create…
I don’t understand why it would be impossible…do what you’re already doing and convert the ground mesh into a terrain. You don’t have to do roads or sidewalks using the terrain tools; leave them as normal meshes.
–Eric
I understand why you are confused. Let me be more specific:
Imagine you are modelling downtown San Francisco. How would you create the terrain? There is no “ground” - just roads, sidewalks and buildings. And the roads have various slopes.
So when do you use terrain and when do you use meshes?
If you used meshes for your roads and sidewalks then you would not use a terrain anywhere. Then how would you place trees? What if there was a park somewhere with grass in various areas? Would you just use a small terrain for the park and place some grass on it? Then what if you had two parks? Would you use two terrains then?
And how would you place trees around the city? If you just place trees as meshes then you get no billboarding at a distance. Would you create a terrain underneath your mesh geometry only to place trees on it so that you get billboarding?
These are exactly the problems I’m trying to solve! Sorry for the long post!
As I said, convert the ground mesh to a terrain and leave the sidewalks etc. as meshes. So those places which should have trees (parks, the area around the city) is a standard terrain and the rest is standard meshes on top of the terrain.
–Eric
So if 95% of the ground geometry consists of roads and sidewalks your suggestion would be to render a huge terrain that is only visible in 5% of the level and render the roads and sidewalks as meshes on top of the terrain?
That seems very inefficient…
If so little is actual terrain, then it sounds like you’d be better off just using standard models of trees and grass. If it’s necessary you can do your own LOD, the simplest way by using camera layer culling distances.
–Eric
Just use the standard trees, and level them into ur scene.
I guess I’m gonna try that. Do you know if there is a way to convert a tree to a billboard at a distance without using a terrain?