You are on page 1of 6

Cliff Material/Shader

Bartosz Haratym

This material should be applied to any mesh that is going


to be used for the cliffs inside the project. As the rapid
iteration, it is open to any further required changes.
This material allows to procedurally generate the position
of the textures, without need to manually unwrap UVs. If
the meshes are close together it allows to merge the
texture giving seemingless texture across two objects.
This material requires two textures: top texture (grass),
side texture (checker) and grey texture( a cutout with
grass details).

Adjustment that are available within the material’s inspector are as follows:
1. Main tiling scale
2. Top tiling scale
3. Top tiling offset
4. Cutout details
5. Top stripes amount
6. Normal map strength (generated from the greyscale texture within shader)
7. Smoothness and Ambient Occlusion

Main Tiling scale

Main Tiling scale allows the user to adjust the scale of the tiles, this time the checker as
scaling the mesh will not impact the scale of the textures.

Top tiling scale


Cliff Material/Shader
Bartosz Haratym

Top tiling scale allows the user to change the scale of the texture (grass) tiles at the top of
the mesh.

Top Tiling Offset

Top tiling offset allows the user to offset the top texture (grass) tiles to required position.

Cutout Details

Cutout Details allows the user to adjust the fine details(from the grayscale texture) and how
it is pronounced.

Top stripes amount

Top stripes amount allows the user to adjust the amount of the stripes visible on the top of
the mesh
Cliff Material/Shader
Bartosz Haratym

This material/shader comes with two meshes and three textures.


Cliff.mesh_1,
cliff.mesh_2,
Cliff_checker_rock,
Cliff_top_grass,
Grass_edge_greyscale,

Idea behind this iteration was to create a material that allows the user to apply it without
need of manual UV unwrapping, not being dependent on the scale of the mesh and to
seemingly merge the textures with colliding meshes with the same material applied. Another
benefit of that method is reduced processing time compared to baked texture and UV, plus it
is less time consuming.
Above requirements can be filled by a few different methods although the one that is
supplied with this document was found giving the best outcomes.
Cliff Material/Shader
Bartosz Haratym

First I had to find the world position and split them into RGB from which we take the XYZ
values ( in a shader called FRONT, TOP, SIDES). This later allows us to differentiate them.

Then, we take a normal vector of the world to receive the world projection of the coordinates.
Which we split into RGB ( XYZ).
Cliff Material/Shader
Bartosz Haratym

World coordinates are blended with the position of the object within the world, giving the
outcome of a triplanar mapping.

Grayscale texture is used to achieve a cutout of the top/sides textures and in above case to
apply the checker texture to white values with use of the Smoothstep and Step nodes.
Cliff Material/Shader
Bartosz Haratym

The cutout was supported by another use of the greyscale texture where tiling and grass
texture gives the option to adjust the tiling.
All of the blended textures and coordinates are later on applied to the Base Color (URPL)

Normal maps were created by the grayscale texture and attached to the Normal map input.

Cons of the mentioned shader:


Due to lack of the UW the texture will be always applied in the same way to all of the
meshes. It depends on the world position rather than the object itself. Due to rounded edges
of the meshes the textures will be always overlapping in those areas to some extent.

You might also like