- Home /
Converting a mesh to terrain
How can i convert a mesh that is a terrain created in blender to a unity3D terrain without allowing unity to smooth out the terrain? i need it to be just as i exported it out of blender.
Here is a example. The ball on the right is what my mesh looks like (I want it like that). And the ball on the left is what my mesh looks like after it is converted into a terrain. http://www.sketchypictures.com/media/2012/07/circles.jpg
Answer by FortisVenaliter · Sep 01, 2015 at 09:20 PM
You basically can't. Unity terrains use HeightMaps. Mesh terrains are un-restricted. So, it's like converting a BMP to a JPEG; it'll never be lossless.
What you can do instead is just use the mesh as your terrain. You may need to write some helper classes to do some of the normal stuff terrain does, but that's likely your best bet if you want 100% fidelity.
@FortisVenaliter Ok thanks for the answer. One more problem i got is i need a solid color painter that paints only on polys. So basically no blending, only "Fills" the poly with a solid color.
No idea. Ask a new question with more detail of what you're looking for.
Some notes on using a blender mesh for your terrain: - For reliable physics, Physx runs better with quads around 1x1m in size. Bigger or smaller is ok, but try to avoid huge or tiny quads. - Collision testing against meshes might not work for certain kinds of rigidbodies, depending on your version of Unity. Update to latest for best support.
You could generate a height map from your Blender terrain. This should be possible in Blender or Unity. The trick is: - make the terrain white + unlit. - enable fog and set it to have linear falloff, setting it to black. Set the fog's start distance to be 0, and end distance to be the height of your mesh (highest point - lowest point). - make an orthographic camera that looks vertically downwards at the mesh. Set the camera's aspect ratio to match the horizontal dimensions of your mesh. Align the camera vertically with the highest point on your terrain. Align the camera horizontally with the centre of your mesh. - capture a screenshot from the camera you made. - use this screenshot as the height map for a Unity terrain.
For the material effect you want, you might need to go with a mesh. Every polygon would need its own duplicate vertices, so they can be positioned in a single-color patch in a UV map, or assigned vertex colours to the same effect.
Answer by Jadiker · Jun 28, 2017 at 03:11 PM
Just found this on another similar post: http://wiki.unity3d.com/index.php?title=Object2Terrain