
A flexible and stylized Contour Line Shader.
Easily render evenly spaced contour lines along the X, Y, and Z axes with gradient coloring, local/world space control, and full visual customization.The Contour Line Shader is a powerful shader designed for the Built-in Render Pipeline that visualizes mesh geometry with clean and customizable contour lines. Whether you’re developing stylized environments, scientific visualizations, or data-driven graphics, this shader enables you to display evenly spaced lines along the X, Y, and Z axes of your models with full control.You can enable contour lines along any combination of axes (X, Y, Z), and customize line thickness(screen-space consistent), line interval and coloring options. Set gradient colors based on Zero (minimum) and Maximum contour line positions, and choose whether to base these positions on Local Space (object-relative) or World Space.Line thickness is calculated in screen space, not world space, so the visual width of contour lines remains consistent regardless of zoom level or object scale.Line Options:Line Interval: Adjustable spacing between contour linesLine Color: Three contour coloring modesLine Thickness: calculated in screen spaceChoose from three contour coloring modes:Gradient between Min and Max line colorsMin Color OnlyMax Color OnlyThe shader also supports:A transparent base color or texture (Base Map)Specular highlights for a polished appearanceAdjustable Zero and Max line positionsSmooth rendering even beyond defined color bounds by clamping to Min/Max colorsWith full axis and color control, Contour Line Shader gives you artistic freedom and technical precision—all in one asset.Supports the following Unity versions:Unity 2018Unity 2019Unity 2021Unity 2022Unity 6000+ (Unity 6.x).In Unity 5.6, the shader code and sample materials are compatible, but the demo scenes are not.Render Pipeline: Built-in Render PipelineContour Axes: Independently toggle X, Y, Z axesCoordinate Space: Switch between Local and World spaceLine Interval: Adjustable spacing between contour linesLine Thickness: Adjustable and screen-space based (remains constant during zoom/scale)Line Color Control:Zero (Min) and Max position settings per axisGradient rendering from Min to Max colorsOptional flat color rendering (Min-only / Max-only)Base Appearance:Base color with alpha supportOptional base texture (Base Map)Lighting Support:Specular highlightsKey Features🔹 Render contour lines along any or all of the X, Y, Z axes🔹 Use Local Space or World Space for line positioning🔹 Fully adjustable line thickness and color gradients🔹 Adjustable line interval for controlling spacing between contour lines🔹 Screen-space line thickness — stays visually consistent regardless of camera zoom or object scale🔹 Gradient coloring based on Zero (Min) and Max positions🔹 Clamp gradient beyond range with Min/Max color continuity🔹 Choose between Gradient, Min Color Only, or Max Color Only🔹 Apply transparent base color and Base Map texture🔹 Specular lighting for realistic highlights🔹 Perfect for stylized rendering, scientific data, topographical maps, and visual effects🔹 Lightweight and optimized for real-time applications