Войти
  • 3042Просмотров
  • 6 месяцев назадОпубликованоLenba Sun

Infinite Grass GPU Instancing (Grass/Plants Shader) by Unity URP 6000

LenbaSun: Shader programming. Directing. Eric Liu: 3D models, lighting, directing Portfolio: 🌾 Infinite Grass GPU Instancing – May 2025 Devlog 🌾 This update features three grass scenes in distinct moods: - Dry Grass at Sunrise - Red Grass at Sunrise - Dry Grass at Night Core Concept Render only grass visible to the camera — nothing more. Key challenges include maintaining spatial consistency during camera movement and rendering dense, expansive grass fields efficiently. Optimization Highlights - Cell-Based CPU Culling: Only visible terrain cells are sent to compute shaders. - GPU Frustum Culling: Off-screen instances are culled on the GPU. - Terrain Height Adaption: Grass aligns accurately with terrain elevation. Lighting Approach - Single realtime directional light - Unity 6000 Adaptive Probe Volume (APV) used for baked lighting - Grass shading leverages APV probes instead of traditional shadowmaps Interaction & Wind Footstep Bending: Trail Renderer writes to a dynamic texture, sampled in shader to bend grass based on character direction and movement. Wind Simulation: - Global sway controlled by Perlin-noise-driven phase offset - Local per-instance variation via instancing offsets - Together, these create cohesive yet varied grass motion ✅ GPU Frustum Culling ✅ CPU Cell Culling ✅ Terrain Height Adaptation ✅ Wind with Per-Instance Variation ✅ APV Lighting Support #unity #urp #shader #grass #gpuinstancing #realtimerendering #adaptiveprobevolume #gamedev