- Home /
Blender Terrain in Unity
Hello,
if I made a terrain in Blender (Unity Terrain does not support holes in the Terrain). What is the Best way to texture it? I think a huge texture on a huge (10k x 10k) is not a good solution. Well I can use tiling for one Texture, but waht if I have more than one Texture for my terrain, like Grass, sand and some stone? Using blenders Texture Paint for a "huge" (20 mb or bigger) Image works well in Blender but for the players who play with unity?
Another question is about the Collider, can i Use a Mesh collider for my Terrain mesh?
isn't 2k x 2k image enough for a game terrain? if not you might as well want to split up the terrain into tiles (like use 4 sub terrains ins$$anonymous$$d of 1 whole) and load them asynchronously. for the collider you will need to generate a low-poly of your terrain, not gonna be a big problem in blender (it's like $$anonymous$$esh > Reduce in $$anonymous$$aya, should be similar in blender).
but I'd advise you to browse some tools on asset store and online first. e.g. Unity Terrain Toolkit (though I don't think it supports holes).
Imagine you have grass texture wich is like 512x512, then you can place it 4 times on the 2k texture, in game it will look a bit like green pixels on the ground.
I found a possible workflow after some experiments:
$$anonymous$$aking a terrain in blender.
$$anonymous$$ake some Texturelayers with Stencil $$anonymous$$apping.
Save the Stencil$$anonymous$$ap texture (its like an alpha map)
export the terrain to Unity
Place the $$anonymous$$esh in the Scene
Select the Terrain mesh (and its Submeshes) and crate an Extra $$anonymous$$aterial or more
In my experiment I use the Basic $$anonymous$$aterial as Grass with the Standart shader.
Now i use the Secondmaterial as Stencil map: for this I used the Standard shader in fade render mode. at the $$anonymous$$ain $$anonymous$$ap (Albedo) i use the Exported stencil map form blender (it hav to be an grayscale alphamap). Now the Secondary $$anonymous$$ap as the Stone texture.
The result looks nice for now.
I Think terrain details (Grass and Trees) like the unity Terrain Engine can only placed by hand.
But, you know Unity terrain uses standard optimizations to run faster? A terrain collider is faster than a mesh collider. Unity terrain uses standard shader tricks to tile and blend multiple textures. You could copy and adapt those for yours (but if you never heard of those tricks before, it will be work.)
You can find threads about models vs. terrain explaining this.
the main reason is: unitys standart terrain does not support holes
Answer by Gf15a4 · Mar 17, 2015 at 12:39 AM
The only way for you to maintain the quality and to edit the textures without the same one repeated over and over is splatmap. A splatmap alows blending of multiple texture which only contains the data of mixing. The textures themselves are repeated but opacity changed based on heightmap. If you really want this performance increase learn n' program up like I did bud.
As for the terrain collision... using a mesh collider for such a large terrain would be very very unsuitable. Instead, you need to come up with an equation yourself that determines the height based on which quad your on, relative location to the quad, then the triangle your on. From there you turn this information over to the berrycentric equation. Trust me, there is no way out of this... if you want to use a mesh collider and lose 30fps on a large mesh than to learn a simple equation then thats fine.
-Brett, hope I helped
Your answer
Follow this Question
Related Questions
Object falls through terrain 1 Answer
Blender terrains and gravity 1 Answer
Large Mesh Colliders and character collider not coliding 0 Answers
Create Terrain in other Software 1 Answer