Hi, There it's Arian. Today, we want to explore the Terrain Shader
Module from The Vegetation Engine. check out the previous video which was about
the Blanket and TVE. The Terrain S hader module is part of the
Vegetation engine. It's important to note that the latest version
of the Vegetation Engine is required for these modules to work. The Terrain Shaders Module is an advanced
terrain shader solution with up to 16 layers supported, height-based blending, and per-layer
planar, tri-planar, and stochastic mapping and it has integration with the Vegetation
Engine global seasons, overlay, wetness, emissive, and height offset for snow or tracks. I've installed the Terrain Shader. In the Boxophobic directory, another folder
named 'Vegetation Engine Modules' is created. Let's open a demo scene from Terrain. The scene is pre-set, so there's no need for
adjustments. Terrain GameObject has a Script Called TVE
Terrain which will send the terrain data to the material. If the Terrain or the Terrain Layers are modified
without selecting the terrain, or they are modified by an external tool, make sure to
set Terrain Refresh to Always. If the height is modified by Vertex Height
elements, you might need to increase the Terrain Bounds to avoid the terrain culling! I'll explain Terrain Settings later for now
let's see the Terrain material. this material is using the BOXOPHOBIC>The
Vegetation Engine> Landscape>Terrain Standard Lit shader. You can tweak stuff like Render Decals and
Alpha Clipping. In Global Settings, adjust the layers and
control the Global color or overlay or others. The terrain supports up to 16 layers, more
than what Unity offers. And there are options to optimize texture
packing for better Performance. You can adjust terrain color, normal, occlusion,
smoothness, and height blend. The "per-layer tri-planar, stochastic, or
tri-planar stochastic" options refer to different mapping techniques. Tri-planar mapping: This technique is used
to texture surfaces without distortion based on the surface's orientation. It blends three texture projections (from
the top, side, and front) based on the surface's normal direction. Stochastic mapping: Stochastic mapping introduces
randomness into the texture projection, which helps to break up patterns and create more
natural-looking surfaces. It's often used to add variation to textures
like grass, rocks, or terrain. Tri-planar stochastic mapping: This combines
the benefits of both tri-planar mapping and stochastic mapping. It applies tri-planar mapping to each layer
of the terrain while also introducing stochastic variations to each layer's textures. These techniques are commonly used in terrain
shaders to achieve more realistic and visual results by reducing texture distortion and
adding natural variations to the terrain's appearance. Season Elements are pre-made, we can easily
change the Season Control and see the effects but in case you don't know how Elements works
Go and watch the Pervious video about The Vegetation Engine. The Global Volume Scale covers the entire
terrain and Element Size. Element Global Colors control the color of
seasons, while Element Global overlay affects only winter, covering the terrain in snow. The Element Road Overlay applies a texture
or mask with a winter value of less than 1, here it is set to 0.2 for reduced snow coverage. Height Offset is a vertex Height Shader that
adjusts the height. For example, a winter value of 1 impacts only
winter, with a Height Scale of 0.5. The Height Noise is the same it just sets
The Render Mode to Constant and it sets the Height Scale to be zero. We can create any Elements and apply them
to the terrain. There is a Demo Scene in Blanket Shader which
uses the terrain shader too and you can see how smoothly it blends the terrain and rock. Terrain Settings will give us the option to
override the layer textures and parameters per terrain or to use Custom Render Textures
or Render Textures with animated effects such as molten lava or animated sand wind which
is not possible by default with the terrain system! These Render Textures use the Custom Shader
Distortion, you can create any shaders you want and assign them. Thanks for watching. The Terrain Shader offers more, but I won't
cover it in this video; it's just a review for today. If you need vegetation for your game, Boxophobic
packages are one of the best options! Check GameDevBox for other Tips and tutorials,
See you next time!