Super Pathfinding system icon

URP&HDRP Terrain Shader - API

Extensible lightweight terrain shader incluing Anti tiling, Snow, and other effects to make your terrain look superb.

CorvoTerrainManager

Class in Corvostudio.CorvoTerrainShader



Description

Component for terrain shader management.

Has public methods for calculating and manipulating terrain shader changing max texture resolution, UV sizes, heightmep management, usued terrain material, snow intensity and more.

Properties

Name Type Description
Name Type Description
standardTerrainMaterial Material Material parameter used to switch back quickly to unity standard material or any other terrain material.
corvoTerrainMaterial Material Material parameter of the HDRP&URP terrain shader you want to apply to the terrain.
terrainUVScale float Tiling scale for all terrain textures. 1 means standard terrain shader tiling. Each terrain layer can have custom tiling from terrain layers.
maxTextureSize MaxTextureSize Maximum texture size you want to have on the terrain. You can edit this at runtime for implementing different terrain quality calling Apply() after changing this value. NOTICE: All textures will be set to the same resolution so it's better to have natively textures all of the sime resolution. You can see how much memory the system is using in unity console after calling Apply() on the editor.
useHeightmap bool Set this to TRUE if you are using a shader variant that uses Parallax. If not, set this to false to save memory.


Public Methods

Name Type Description Arguments
Name Type Description Arguments
Apply() void Apply the changes made to this class at runtime. It's the same to press "Refresh all" on editor inspector..
IsCorvoTerrain() bool Return true if currently the URP&HDRP Terrain Shader material is in use.
SetCorvoTerrain() void Set Corvo terrain material on current terrain. Also generates and applies textures, if not already in RAM.
IsStandardTerrain() bool Return true if currently the standard terrain material is in use.
SetStandardTerrain() void Set current terrain material as standard terrain material. (bool) clearTextureBuffer: if true and on play mode, generated textures for corvoterrain material will be removed from the RAM.
GetTerrain() Terrain Get the linked terrain to this component.
TextureArraysChanged() bool Returns true if textures properties has been changed. If this is true, the shader will probably need a refresh pressing Apply().
GenerateTextureArrays() long Generate textures in RAM for the HDRP&URP Terrain shader. (bool) alsoApply: Also apply the generated textures. If false, you will need to call Apply() yourself.
SetSnowIntensity() void Set snow intensity if material allows it. [0,1] value of intensity.

CorvoNodes

Terrain Shader nodes collection available in Shader Graph. Can be used in other Shader Graph shaders as well.



Description

Nodes for replicating corvo terrain shader effects on your own shaders.


Public Nodes

Name Description Input Output
Name Description Input Output
CorvoSnowProcess

Node to replicate the snow from the standard HDRP&URP terrain Shader to any other Shader Graph shader. (Color) SnowColor: Desired snow color.
(Texture2D) SnowTexture: Texture for the snow.
(Texture2D) SnowNormal: Normalmap for the snow.
(Texture2D) SnowTiling: Tiling for the snow (SnowTiling.x,SnowTiling.y) and for the snow noise (SnowTiling.z,SnowTiling.w).
(Texture2D) SnowIntensity: Amount of snow desired.
(Texture2D) SnowFadeIntensity: Fade intensity on slopes, near water level and around noise.
(float4) Basemap: Original albedo output of the shader.
(float4) Normal: Original normal output of the shader.
(float) Metallicness: Original metallic output of the shader.
(float) Smoothness: Original smoothness output of the shader.
(float) Water level: Height cutoff of the snow.
(Texture2D) SnowNoise: Noise mask for the snow.
Albedo: Albedo output
Normal: Normal output
Metallicness: Metallicness output
Smoothness: Smoothness output

Home
Contacts
Newsletter
Other Projects

© Corvostudio 2020