Przeskocz do zawartości
Multimedia 1 dla listy GPU Instanced Foliage & Grass Renderer

Opis

GPU Instanced Foliage & Grass Renderer:

Scatter tens of thousands of GPU-instanced grass, flowers, or foliage across your scene — fully GPU-driven, terrain-aware, and wind-animated, with real benchmarked performance numbers instead of a headline claim.

This is a renderer, not a content pack. Bring your own mesh — grass, flowers, rocks, or anything with geometry — and this asset handles the GPU-driven placement, culling, and instanced drawing at scale.

Key Features

  • Fully GPU-driven pipeline — placement, culling, and drawing all run on the GPU via compute shaders and Graphics.RenderMeshIndirect. No per-instance CPU overhead.

  • Real terrain-aware placement — automatically detects your scene's Terrain and samples its actual heightmap. No manual alignment needed.

  • Slope-normal alignment — instances lean to match the terrain's slope instead of always standing world-vertical.

  • Slope-based placement filtering — soft, gradient-thinned culling on steep terrain instead of a hard, poppy cutoff.

  • Natural, organic distribution — noise-driven density creates clumpy, irregular coverage instead of a uniform lawn, with a Scatter Amount slider to dial it back toward an even spread whenever you want less randomness.

  • Dynamic wind system — six built-in presets (Calm through Tornado) or full custom direction/turbulence/gust control, switchable live at runtime via a public SetWindPreset() API. Includes an optional 1–6 hotkey preview component for fast iteration in Play mode.

  • GPU frustum culling, every frame.

  • Distance-based texture LOD — a tunable near/far blur ramp keeps close-up detail sharp while distant, densely-packed instances stay free of aliasing.

  • Alpha cutout support for cards, billboards, or any cutout-style foliage texture.

  • Runtime density changes via a public Reinitialize(int) method — for streaming or dynamic density without restarting.

  • Works with any mesh you supply.

  • Full source included — inspect, modify, and extend the C#, compute shader, and shader code freely within your own projects. Redistribution of the source is not permitted.

Most instanced-grass assets either skip a wind system entirely or lead with a big instance-count number and no real context for it. This one ships with both a genuine wind system and honest, documented performance data from an actual build — see below.


Performance — Real Numbers, Not a Headline Claim

Benchmarked in a standalone Release build (not the Editor), on a 4GB legacy/budget GPU, an NVIDIA Quadro M1200:

500 instances — 67 avg FPS (14.89 ms)

2,000 instances — 48 avg FPS (20.78 ms)

5,000 instances — 26 avg FPS (38.61 ms)

10,000 instances — 16 avg FPS (63.66 ms)

Smooth, real-time performance up to ~2,000 instances even on legacy hardware, scaling gracefully to 10,000+ for scenes that can afford it.

Requirements

  • Unity 2022.3 LTS or newer (developed and tested on 2022.3.62f LTS)

  • Built-in Render Pipeline (BiRP) only — this version does not support URP or HDRP

  • A GPU with Shader Model 5.0 / compute shader support (desktop-class; not intended for mobile or WebGL targets)

  • Your own mesh to scatter — not included

What's Included

The renderer component, the two compute shaders (generation + culling), and the instancing shader. No meshes or textures are included — bring your own foliage mesh and texture.

Known Limitations

  • Built-in Render Pipeline only — no URP or HDRP support in this version.

  • The shader reads two texture channels — Albedo/Diffuse and an Alpha Cutout Mask. No normal mapping, roughness, AO, or other PBR channels. A strong fit for simple grass, flower, and rock meshes; not a fit for trees or PBR-textured hero rocks.

  • One mesh per component — for a mix of foliage types, add multiple components, one per mesh.

  • Your mesh needs Read/Write Enabled in its import settings.

Support

Published by TessaractLab. Contact: [email protected] / [email protected]

Visit website: GPU Instanced Foliage Renderer | Tessaract Lab

Link to documentation: tessaractlab.com/docs/GPU_Foliage_Documentation.md

Uwzględnione formaty