Hey everyone, the other day I had a really interesting and informative conversation with someone on the UE4 Devs facebook page about landscapes and I learned alot of things that I was pretty fuzzy about before that point, so I thought I'd share the conversation with you all to help spread some of this seemingly rare knowledge.
Feel free to add in more info in your comments. The more knowledge we all share, the better all of our projects will be!
- -Me-
- So, I've been looking into World Creator and World Machine lately, and I've been wondering, just how detailed can you get in programs like those? Like, I understand that they do huge multi-mile areas really well, but what if you want alot of detail in the 'player character' scale and only for it to seem like it is part of a larger area. Can/how do you do that? That is the point that confuses me the most, because I cant help but imagine that if you have to rely on the most basic in editor sculpting tools, like what you have in UE4, that the difference in quality/lack of matching the large scale look, would cause quite the visual disparity. Anyone able to shed some light on this subject?
- David R. Green
- The Landscape polygon size has to be quite large simply for video game render performance reasons. A level designer might typically use 128, 192, or 256 or larger Unreal Units for polygon vertex spacing. All fine detail should be designed in such things as normal maps on the Landscape materials (eg. sand, dirt, or gravel bumping), and static meshes used for such things as rocks and boulders.
The terrain software that I developed, TerreSculptor, can import very high resolution Digital Elevation Models, which actually have a decent amount of small detail in them. Equivalent Landscape polygon vertex spacing may be as low as 8, 16, 24 or 32. These DEMs are fine for such things as visualizations, or use in 3D software rendering. But the issue with using them in a video game is based purely on performance. Landscapes with vertex spacing that close is simply too many millions of polygons to render per frame across all platform hardware. Does this help any?
- -Me-
- Cool program. Surprised I didn't see it when looking at other similar programs. So, UE4 uses one of those higher numbers (128,192,256,etc) for its landscape vertex spacing? Do we have control over how close those are during landscape creation? I've not noticed any such options, but its easy for me to miss things im not looking for. And about the DEMs that you were talking about, when you export them from your program, if they have that high level of detail, do you need alot bigger texture sizes, or do you export them in smaller chunks of terrain? If, lets say, I wanted to make a game like older Monster Hunter games where they had relatively small areas with loadscreens between them, would these smaller vertex spacings work out well enough since the play area was so much smaller (think size of a football field or two at biggest). If I did have such small spacing, would it be possible to distance blend between that high detail and a lower detail one? (I know its possible to have destance based tessalation based on textures, but I've not heard it be based on two different detail levels of landscapes). Are there any programs that are able to focus on that super small level of detail, like are their procedural tools accurate enough to have the simulations be correct for that small of size if you zoomed in close enough? Sorry for all these questions, they are not just directed at you, but at the UE4 group as a whole.
- David R. Green
- Thanks.
The free Standard Edition can be used commercially as well. The Professional Edition has been getting free updates since release with more features coming. Sales only cover domain hosting and corporate fees so I don't make any money on it.
The Landscape polygonal size (vertex spacing) is changed using the Scale property I believe. The Landscape "Scale" property I believe is in UUs. It defaults to 100. You can see the vertex spacing in wireframe mode against the grid.
If the Landscape terrains that you were creating were small enough, such as a 2017x2017 heightmap, and at a 16 or 32 UU vertex spacing, you would have a very detailed terrain that could still possibly render fast enough on most current hardware. Some development tests would be the only way to tell for sure.
The Landscape renders and culls and LODs based on Components, so if you chose the optimum values you should get pretty good performance. If this was a football field size Landscape, and all of it was in the frustum, chances are you will render all terrain polygons.
Keep in mind that a 2017x2017 Landscape would be approximately 8M triangles. Material complexity may also become a factor at a Landscape of that Scale spacing.
Landscape uses distance LOD by default. LOD is by Component. So your terrain would have that by default.
The thing you may have to watch for is LOD warping of the distant terrain changing the look too much. Especially if it was only football field size.
- -Me-
- Ok, so assuming that I was going for a 2017x2017 landscape, does that mean the texture (heightmap) itself is 2017x2017 pixels, or does that just refer to the landscape size and the texture itself would be more along the standard 2048x2048, etc. Also, If the texture IS using the standard sizes, does a regular 2048 size texture hold enough data for a 2017x2017 landscape at smaller 'scale' numbers? Or would you need to get a bigger texture, like 4096, or 8192, to get the detail necessary? Or am I understanding this all wrong, and the terrain literally gets smaller with smaller 'scale' (vertex spacing) values, and thus the texture doesn't have to work on such a large landscape? (I am going by my memory of one time creating a 2017x2017 sized landscape and I think it was alot bigger than a football field, if my memory serves).
- David R. Green
- The Landscape resolution, eg. 2017 x 2017, is the same resolution as the underlying 16-bit Heightmap. I always refer to these as Heightmaps instead of textures, to prevent confusion with the Material textures (grass, dirt, etc.) used in the shaders.
If you are creating a 2017 x 2017 Landscape, you do require that the Heightmap be the same resolution. This is actually determined when you import the Heightmap, the Landscape actor will automatically size itself to the imported Heightmap. Heightmaps for the UE3 and UE4 Landscape actor must be oddball sizes because of the odd design paradigm that Epic used. You can find the list of optimal Landscape and Heightmap sizes on the UE4 documentation pages. 505, 1009, 2017, 4033, etc.
The 16-bit Heightmap data determines the Z altitude value of each terrain mesh vertex. The resolution eg. 2017 and the Scale value determine the total width and length of the Landscape actor. So a 2017x2017 Landscape and Heightmap at a Scale of 100 will result in a Landscape terrain that is 201700 x 201700 Unreal Units (cm) in size.
The actual textures that you will be using in the Material for the Landscape, such as grass, dirt and rock, those are typically in power-of-two values, eg. 2048x2048, 4096x4096, etc. And they often consist of a diffuse texture and normalmap texture.
Your 2017x2017 Landscape would by default be larger than a football field. You would use the Scale properties to reduce the vertex spacing, or effectively the dimensions of each polygon quad.
As mentioned previously, a 2017x2017 Landscape/Heightmap at a Scale of 100 will result in a Landscape terrain that is 201700 x 201700 UUs, and therefore a 2017x2017 Landscape/Heightmap at a Scale of 50 will result in a Landscape terrain that is 100850 x 100850 UUs, or half the width and length. The size of each quad would also be half, creating a higher resolution detail to the Landscape terrain.
- -Me-
- Ok, now its all making a bit more sense. I never had figured out what they were talking about on that landscape sizes page, but now it makes sense. Thanks! All I need to do now is figure out how to use the various landscape tools around to model smaller landscapes, when they are designed to model huge landscapes.
- David R. Green
- TerreSculptor works equally well with small 256x256 through large 32768x32768 Landscapes, even from Digital Elevation Models which in my opinion give the best look. Some of the Erosion tools work well with small heightmap files. Play with the free Standard Edition of the software if you like. There are some free content files including DEMs available on the Forums at the link below, note that some of the free files are for the Professional Edition. If you ever need DEM files resampled smaller for the Standard Edition you can always contact me on the Forums or by email.
http://www.demenzunmedia.com/forums/viewtopic.php?f=8&t=6
- -Me-
- Awesome! I'll definately give it a try.
- -Me-
- Hey, do you mind if I share our conversation on Polycount? This is the most informative discussion I've had about landscapes and I'd really like to share it with others.
- David R. Green
- Sure, no problem, go ahead and share.
- Gareth Martin
- If you're wondering why the UE landscape sizes are so odd, it's because while each component is a power of 2 size, they have to duplicate the line of heights (vertices, texels, whatever) where two components touch - otherwise there would be a gap of one line of triangles between components! This reduces the _effective_ resolution of a landscape component to one less than a power of two. Multiply that up by the number of components and you have your odd size!