Thungsten Grid — Documentation
Version: 2025.04.21a
Pipeline: Built-in (BRP) | Universal (URP) | High Definition (HDRP)
Links: Unity Asset Store
Overview
Thungsten Grid is a highly configurable, world- and local-space grid shader for Unity. It renders crisp, anti-aliased grid lines in world units with constant thickness, distance-based fading, and multi-layer hierarchy blending — ideal for strategy games, terrain overlays, simulations, and design tools.
Features
- World-space or local-space alignment: Projects cleanly over any surface — perfect for terrain overlays, planning tools, simulation systems, and RTS-style maps.
- Multi-layer support: Blend two grid layers (e.g. 1m / 10m) through one material shader.
- Fixed line thickness: Gridlines retain constant width in world units — no matter the grid spacing or camera zoom.
- Anti-aliased lines: Uses screen-space derivatives to reduce shimmer and aliasing at distance.
- Camera distance fade: Fade grids out smoothly with configurable start/end range and fade strength.
- Soft Mask fade: Fade out towards a certain world position, e.g. character or mouse cursor.
- Texture fill: Fill individual tiles in the grid with colors from a texture, allowing you to show different states such as walkable, weights, or other.
- User-friendly UI (New in 2025.04.21a): Comes with a tailored ShaderGUI that replaces the default inspector for streamlined material setup.
- Fully runtime configurable: Control any settings during runtime for varying and smooth effects.
Requirements
BRP
- Unity 2021.3 LTS or newer
URP
- Unity 2021.3 LTS or newer
- Decal Projector support enabled in URP Asset
- URP Asset Renderer → Add Renderer Feature → Decal
- (Optional) Technique: Screen Space preferred
HDRP
- Unity 2021.3 LTS or newer
- Decal Projector support enabled in HDRP Asset
- HDRP Asset → Rendering → Decals → Enable
Getting Started
- Import Package
Import Thungsten Grid via the Unity Package Manager or Asset Store - Configure pipeline support
Depending on your rendering pipeline, see requirements above and enable decals - Open the DemoScene and hit Play OR continue below
Create an empty GameObject
Add a [Projector / URP Decal Projector / HDRP Projector] component
Assign one of the included Materials to the projector
Set size to encompass your grid area
Tweak shader settings to your needs
Shader Settings
Property | Variable Name | Type | Description |
---|---|---|---|
World to Local | _WorldToLocal | Float | 0 = world space, 1 = local space grid alignment |
Anti-aliasing Baseline Feather | _AA_BaseLine | Float | Base feather width for anti-aliasing |
Anti-aliasing Distance Feather | _AA_Distance | Float | Additional feather scaling with distance to camera |
Fill Color | _Fill_Color | Color | Color used for area between grid lines Leave transparent for no fill |
Fill Texture Size | _Fill_Texture_Size | Float | Size in pixels used for aligning fill texture per cell Only available in HLSL |
Fill Texture | _Fill_Texture | 2D | Optional fill texture applied under the grid Color is multiplied by Fill Color |
Soft Mask World to Local | _Soft_Mask_WorldToLocal | Float | 0 = world space, 1 = local space |
Soft Mask Distance | _Soft_Mask_Distance | Float | Distance for enabling soft masking |
Soft Mask | _Soft_Mask | Vector4 | Mask origin and weight (X, Y, Z, Weight) |
Grid A Color | _Grid_A_Color | Color | Line color |
Grid A Size | _Grid_A_Size | Float | Spacing |
Grid A Thickness | _Grid_A_Thickness | Float | Line thickness |
Grid A Fade | _Grid_A_Fade | Vector4 | Fade distances for min, mid, max, and fade weight Faded out at min and max, strongest at mid Set weight (W) to 0 to turn off |
Grid A Fade Factors | _Grid_A_Fade_Factors | Vector3 | Fade factors per axis Set X = 0, Y = 1, Z = 0 to only fade based on height |
Grid B Color | _Grid_B_Color | Color | Line color |
Grid B Size | _Grid_B_Size | Float | Spacing |
Grid B Thickness | _Grid_B_Thickness | Float | Line thickness |
Grid B Fade | _Grid_B_Fade | Vector4 | Fade distances for min, mid, max, and fade weight Faded out at min and max, strongest at mid Set weight (W) to 0 to turn off |
Grid B Fade Factors | _Grid_B_Fade_Factors | Vector3 | Fade factors per axis Set X = 0, Y = 1, Z = 0 to only fade based on height |
Usage Notes
- Line thickness is in world units, not screen pixels — this gives consistency across zoom levels.
- Secondary lines suppress overlapping primary lines by default — clean visual hierarchy.
- You can animate Fade Mid (Y) for a "reveal" or scanning effect.
Troubleshooting
Problem | Fix |
---|---|
Grid looks blurry or aliased | Adjust feather values (e.g. 0.005), or enable TAA or other anti-aliasing |
Grid lines vanish at high zoom | Increase Line Thickness or decrease Fade Distance Weight |
Fill texture looks blurry | Set texture filter mode to Point and compression to None |
Grid appears in Scene view but not Game view | Ensure the projector's layer is included in the camera's Culling Mask |
Grid not visible in HDRP | Make sure HDRP Decals are enabled in the HDRP Asset (Rendering tab) |
Grid not visible in URP | Make sure the URP Renderer has a Decal Renderer Feature enabled |