Skip to content

kids.kapish.terrains.urp

unity

Universal Render Pipeline terrain shaders for Carrot.

Installation

Add to your Unity project's package manifest:

json
{
  "kids.kapish.terrains.urp": "file:../../src/unity/kids.kapish.terrains.urp"
}

Requires Unity 6000.0+ and URP.

Architecture

Pipeline-specific package

This is the URP arm of the terrains family, mirroring the flexui / flexui.urp split: render-pipeline-coupled assets live in their own package so the pipeline-agnostic core (kids.kapish.terrains, the sampler abstraction) carries no URP/Shader Graph dependency. There is intentionally no code dependency on kids.kapish.terrains — the shader consumes nothing from it; the shared terrains prefix is domain grouping, not a reference.

TerrainVertexColor

A URP Lit Shader Graph (UniversalTarget + UniversalLitSubTarget) built from stock nodes:

Vertex Color ──▶ Power (exp 2.2) ──▶ Multiply ──▶ BaseColor

                              Color property (tint)
Metallic  (Vector1 property) ───────────────────▶ Metallic
Smoothness (Vector1 property) ──────────────────▶ Smoothness

The Power(2.2) node is the point of the package. Mesh vertex colours authored/painted in sRGB are interpreted linearly by the Lit shader, so the terrain reads washed out / too bright. Raising the vertex colour to ^2.2 applies the sRGB→linear gamma so the painted result matches intent. (A true sRGB-decode is a piecewise curve, but the ^2.2 approximation is the standard, cheap fix and is what was dialled in here.)

The graph is self-contained — no subgraphs, no custom-function .hlsl, no third-party nodes — so it has no dependency beyond URP itself.

File Structure

Runtime/
└── Shaders/
    └── TerrainVertexColor.shadergraph

Provenance

Adapted from a stock URP vertex-colour terrain Shader Graph (originally a low-poly terrain tool's URP support shader), re-pathed to Carrot/Terrain/Vertex Color with the ^2.2 gamma correction baked in. Lifted out of the vendor asset tree so the fix is versioned and survivable.

Dependencies

DependencyKind
com.unity.render-pipelines.universalruntime — URP Shader Graph target

Build

Import via Unity Package Manager. Requires Unity 6000.0+ and URP.


Usage Guide

Universal Render Pipeline terrain shaders for Carrot.

Applying the shader

  1. Create a material (Assets → Create → Material).
  2. In the material's Shader dropdown, pick Carrot → Terrain → Vertex Color.
  3. Assign the material to your vertex-coloured terrain mesh (e.g. low-poly / mesh-terrain output that bakes colour into vertices).

Properties

PropertyPurpose
ColorTint multiplied over the (gamma-corrected) vertex colour. Leave white for pass-through.
MetallicConstant metallic value for the surface.
SmoothnessConstant smoothness value for the surface.

The vertex colour itself comes from the mesh — paint it in your terrain tool; the shader handles the brightness correction.

Why the ^2.2

Mesh vertex colours are authored in sRGB, but a Lit shader treats incoming colour as linear — so feeding raw vertex colour straight to BaseColor renders the terrain washed out and too bright. This graph raises the vertex colour to ^2.2 (sRGB→linear gamma) before BaseColor, so what you painted is what you get. If you author vertex colours in linear space instead, you'd want to remove that node — but for the normal sRGB authoring path, leave it.

Tips

  • Low-poly / mesh terrain — this is for terrain whose colour lives in vertices, not splat maps. For splat-texture terrain you want a different shader.
  • Too dark now? — if a future asset authors vertex colours already in linear, the ^2.2 will double-correct and darken. That's the one case to fork the graph and drop the Power node.

Carrot