Can someone please help me figure out how to use Unity’s terrain tools on my SketchUp terrain?
Unity uses a height map, which is just a grayscale bitmap that is usually square, and typical power of 2 sized (1024x1024 for example). As you use the Unity brushes you’re just altering that image.
Your challenge is how to turn your geometry into a height map. I haven’t found a direct way to do it in SketchUp, but it can be done with Blender:
It’s very easy:
- camera, standard views, top, parallel projection, zoom extents;
- style tool so your background is black;
- fog tool, the topmost part of the terrain is white, the bottom is black and then you adjust to have the maximum range possible on gradient from the top to the bottom
- export image and crop
I wouldn’t have said “very” easy, but it did work out ok, thanks.
To get the image to be the right kind of Raw that Unity would accept was slightly tricky. I picked up tips in this discussion:
The antialiasing in my test led to ragged edges, but that shouldn’t be a problem with a normal terrain.
I think it’s easy enough but you are, of course, limited to an 8bit depth image.
The jagged edges would probably be solved by antialiasing settings on your sketchup preferences and you must make sure you export your image at a custom size.
If you have access to a render engine like thea, you can export it much easier as a depth channel of your render and on an exr, hdr, tiff format, which will allow for 32bit color depths.
Unity does take 16 bit grayscale Raw files. Here’s my SketchUp test model and the terrain that it made.
However, if you export a sketchup image it will only be 8 bit. even if you then save it as raw in photoshop, the color info inside won’t grow.
In the example above, with flat levels, problem won’t be noticeable (even if the top is shorter,as that might be due to other reasons), but with smoother surfaces you might have artifacts.
Saving from a render engine as 16bit depth map would be better.
Would most renderers be able to do the similar fog trick? Or do they have other ways to illuminate a top down view so that the nearest geometry is white and the farthest is black?
By the way, I think Forestr’s plan was to make this be the starting point, the Unity tools could smooth out some of the artifacts.
If you can import the terrain flawlessly, why use smoothing tools?
Some renderers like thea or vray can createbrender channels. The channel you describe here is a depth map. Nearer point is brighter, farthest point is black. In thea you can also focus on a max and min distance so you get the depth map from the geometry only inside those two distances from camera.
If you export this depth channel as 16 or 32 bit maps, it gets really accurate and there should be no artifacts.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.