Landscape materials in UE4 can be quite daunting to tackle. Most of what your player will be looking at in your environment is the landscape, yet if the landscape material is too complex, it will become the worst performance hit in your project. Multiple surfaces need to blend in with each other, and the surface needs to work both up close and further in the distance, which means expensive materials all around! But mountain ranges are especially tricky with those tall, vertical mountainsides that stretch out textures beyond belief. So, how exactly is anyone expected to make a good mountain range or cliff using landscape in a videogame, exactly? Turns out, the answer is pretty novel: use world positioning to map a texture at the X and Y planes, blend around the edges, then blend that with a top surface to prevent too much texture stretching at the top. Along with that, you can use another simple color blend texture (1 pixel wide, 64+ pixels tall) to wrap up and create those nice Grand-Canyon-esque layers in the rock.
Benefits to this method:
- Completely seamless texturing!
- Supports normal maps, roughness maps, parallax occlusion, and all other texturing methods!
- Looks great on both steep cliffs and smooth slopes!
- World-aligned means you can set up geologic layers in the rock, and no matter how your models are positioned the material will still look appropriate!
- World-aligned also means you don't need to setup UVs on any objects! Yay!
- Cheaper than most complex materials to achieve XYZ texturing (22 extra instructions to go from basic UV texturing to XYZ seamless).
Limitations of this method:
- The cost is more expensive than basic texturing via UV coordinates: plenty of blending and interpolation needs to be done to get it to function properly. But this cost is not bad for the final result.
- Can be tricky to get complex textures to look good. Wrapping textures and smooth tops work the best. Complex blends can work with a more advanced mask setup, but also costs more in performance.
This method was used on a rock surface costing only 110 instructions (vs. 88 for basic texturing). All things considered, this is the cheapest and best-looking XYZ blendable method I know of.
Side blend (-X and +X are white, -Y and |
Top blend (Z+ is white, perpendicular and bottom is black)
|
Final lit blend |
This technique works on any kind of rocky assets! Just note that texture seams in the UVs will also cause the vertex normal to split, and, by association, this texturing method as well. If you're serious about using this method for perfectly seamless texturing on rocks, you can import your model without any UVs at all. Smooth normals alone will be fine. But if you like your Z-Brush normals, you can use a world-space version of those instead of the vertex normals :)
hey man can u send a screenshot of the material using parallax occlusion with world aligned texture ?
ReplyDeleteWow! Sorry for the late reply. Unfortunately, I no longer recommend using parallax occlusion for this material. Since you'd have to perform the parallax 6 times, it would bog down performance to an insane degree, and landscape is already hard enough to render. Plus, parallax doesn't behave well with blending: parts of the material will appear to "float" over others. I think having good textures and normals will trump parallax effects, which should be kept to a minimum if you choose to use any at all.
DeleteCan you rotate it so it's slanted?
ReplyDeleteYes you can! I forgot the exact means of it, though. Something to do with the UVs of the texture and world z values...
Delete