精選文章

SmallBurger Asset Home

  SmallBurger

2026年11月18日 星期三

Rethinking Massive Mobile Foliage: A GPU-Driven Procedural Approach for Multi-Species Vegetation


Rendering dense, multi-species foliage fields on mobile platforms has long been a challenging balancing act between visual fidelity, memory constraints, and driver compatibility. While modern APIs support instancing techniques like DrawMeshInstancedIndirect, scaling scenes from a single grass type to dozens or hundreds of heterogeneous foliage species introduces unexpected CPU overhead and compatibility pitfalls—especially on low-to-mid-end mobile GPUs.

In this article, I will break down the architectural bottlenecks of traditional GPU instancing pipelines and introduce GPUFoliageSystem, an alternative GPU-driven approach engineered specifically for ultra-fast initialization, low memory consumption, and broad cross-platform stability on mobile hardware.

1. The Bottlenecks of Traditional GPU Instancing

In standard grass rendering pipelines, a typical workflow relies on:

  1. Storing instance transform matrices in Shader Storage Buffer Objects (SSBOs).

  2. Performing per-instance view frustum culling using a Compute Shader.

  3. Writing visible instances to an Append SSBO.

  4. Reading visible instances in the Vertex Shader and drawing via DrawMeshInstancedIndirect.

While this works smoothly for a single vegetation mesh, scaling up to multi-species environments reveals major structural limitations:

A. The Overhead of "Empty Draw Calls"

When vegetation species vary in mesh geometry or shaders, instances must be separated into distinct species buffers. Because culling is executed entirely on the GPU, the CPU has no prior knowledge of which species are currently visible on screen without incurring high GPU-to-CPU readback latencies.

Consequently, the CPU must submit a DrawMeshInstancedIndirect call for every single vegetation species in the scene, every frame—even if zero instances end up visible. As species counts grow into dozens or hundreds, the cumulative cost of CPU submission, command serialization, and GPU command overhead quickly becomes non-negligible.

B. Massive Memory Footprint & Bandwidth Constraints

Storing pre-baked transform matrices for a million instances consumes significant VRAM. At 64 bytes per float4x4 matrix, 1,000,000 instances require ~64 MB of raw matrix data alone, excluding other per-instance attributes.

  • Static Loading: Demands heavy matrix generation, long startup loading times, and high VRAM allocation.

  • Streaming: Requires continuous region loading, data updates, and high CPU-to-GPU memory bandwidth.

C. Vertex Shader SSBO Driver Incompatibilities

To retrieve culled instance data, traditional approaches require the Vertex Shader to access SSBOs directly. While widely supported on desktop and high-end mobile devices, this feature remains inconsistent across older mobile GPU architectures and driver implementations—most notably on certain Mali GPUs. This inconsistency breaks rendering or causes crashes, limiting cross-platform reliability.

2. Architectural Solutions in GPUFoliageSystem

To overcome these hurdles, GPUFoliageSystem introduces three fundamental architectural shifts:

Solution I: Unified Geometry & Texture Atlasing via Filter Maps

To eliminate per-species API draw calls, the system unifies vegetation rendering using a Billboard Quad + Tile Texture Atlas approach. All foliage types share a single mesh template and a unified generation/culling/rendering pipeline.

To track which species belongs to which instance without splitting draw calls, species IDs are recorded in a specialized Filter Map.

Solution II: On-the-Fly GPU Procedural Generation

Instead of baking and storing full float4x4 transform matrices for a million grass blades, GPUFoliageSystem completely eliminates pre-baked transforms. The system only stores procedural rules: generation bounds, density rules, species IDs, and noise/random parameters.

The Compute Shader procedurally generates instance positions and transforms on the fly during runtime. Shifting the editing paradigm from "individual instances" to "procedural generation rules" dramatically reduces memory footprints, avoids serialization overhead, and cuts startup loading costs to two-digit milliseconds.

Solution III: Cross-Platform Culling via CountBuffer + RenderTexture

To solve the Vertex Shader SSBO compatibility issue on mobile devices, GPUFoliageSystem replaces the standard AppendBuffer SSBO with a CountBuffer + RenderTexture pipeline for storing culling results.

Since texture sampling in Vertex Shaders is universally supported across virtually all mobile GPUs and graphics APIs (OpenGL ES, Vulkan, Metal), this approach avoids driver-level SSBO limitations on older Mali and Adreno devices, ensuring consistent cross-platform execution.

3. Core Features of GPUFoliageSystem

  • Mobile-First Design: Smooth performance optimized to prevent crashes or slowdowns on low-to-mid-end mobile hardware.

  • Ultra-Fast Loading: Initialization and loading times maintained within sub-100ms (two-digit milliseconds).

  • Compute Shader Culling: High-performance per-instance View Frustum Culling integrated with Filter Map masking.

  • Mesh-Independent Painting: Works directly on any arbitrary 3D static mesh without relying on Unity Terrain.

  • Interactive GPU Brush System: Compute Shader-driven brush for real-time foliage painting and editing.

  • Multi-Species Scaling: Supports up to 100 distinct foliage species mapped via Filter Map IDs.

  • Procedural Clustering: Procedural group generation linked directly to Filter Map distributions.

  • Dynamic FX: Includes wind animation controls, character pushing/bending interaction, and building/obstacle mask culling.

4. Real-World Performance: Galaxy S8 Benchmark

To demonstrate hardware stability on legacy platforms, GPUFoliageSystem was benchmarked on a Samsung Galaxy S8 (Mali GPU):

  • Instance Count: 1,000,000+ instances

  • Species Diversity: ~20 active foliage species rendered simultaneously

  • Performance: Stable 60 FPS


5. Conclusion & Links

By transitioning from static matrix storage to GPU procedural generation and utilizing texture buffers instead of SSBO vertex reads, massive multi-species foliage systems can achieve stable 60 FPS performance even on older mobile devices.

2026年8月12日 星期三

Why Are Traditional Terrains Performance Killers on Mobile? Z-Terrain (Zero Deform Ultimate Mobile Landscape) Development Insights and Solutions

For a long time, implementing expansive, open-world landscapes on mobile devices has been an extremely tricky task. Because running Unity's native Terrain system directly on mobile phones incurs completely unacceptable performance overhead, the industry's conventional compromise is to use plugins like Mesh Terrain Editor Free or Terrain To Mesh to convert the terrain into Meshes for rendering.

However, this long-standing conventional pipeline hides three "fatal pain points" that cause the most headaches for R&D teams:

Pain Point 1: Unnecessary Waste of Geometry in Flat Areas (Vertex Pressure)

When traditional plugins convert native terrain to a Mesh, they typically can only use a naive, uniform subdivision algorithm. This leads to a very absurd phenomenon: a perfectly flat beach or grassy plain is assigned the exact same density of triangles and vertices as a steep cliff.


These densely packed vertices, which offer zero visual contribution, needlessly waste the computational resources of the Vertex Shader on mobile GPUs, resulting in a severe geometric performance burden.

2026年3月3日 星期二

Development Insights: GPUDrivenForwardPlus



I have always been deeply fascinated by Forward Plus lighting architectures. Before the official URP Forward Plus was released, I implemented a custom Forward Plus solution for URP based on Depth Pre-pass, known as ForwardPlusURP

The core logic of that version followed the classic Tile-based Forward+ approach: it rendered a depth pre-pass to calculate the depth range for each tile and performed light culling to reduce the cost of light loops in the fragment shader.

2026年1月8日 星期四

SmallBurger Plugins Now Support Unity 6.3 LTS

 

A selection of SmallBurger Asset Store plugins has been tested and verified with Unity 6.3 LTS.


Currently, 8 out of 21 plugins have been validated on Unity 6.3 LTS.

Additional plugins will be tested and updated progressively based on project priorities.


You can find the complete SmallBurger plugin lineup on the Unity Asset Store publisher page:

👉 Smallburger

2025年12月17日 星期三

🌸GPU-Driven Poetic Dynamics: From Simulating Ghost of Tsushima’s Iconic Flower Field to the Birth of a Complete Vegetation System

 

In my previous post, Simulating Ghost of Tsushima’s Iconic White Flower Field in Unity, I wrote:

“I hope it can eventually run just as smoothly on mobile devices.”

That goal was achieved sooner than expected.
And that white flower field is no longer alone.

Today, the same architecture can support twenty types of vegetation — all processed on the GPU — handling wind simulation, interaction, painting, and culling simultaneously.

This article is not merely a showcase of results, but a record of the journey — from a simple flower field experiment to a complete vegetation system.
A journey to find what I call “poetic dynamics” on the GPU.

2025年11月25日 星期二

Camera-Adherent GPU Particles 1.0.3 — Multi-Light, Forward+, and Hybrid Lighting Upgrade


The 1.0.3 update brings a major visual improvement to the Camera-Adherent GPU Particle system.

This release focuses purely on foreground, camera-facing particle effects—such as wind swirls, impact bursts, weapon trails, magic glows, atmosphere streaks, UI-adjacent FX, and any particle that stays tightly aligned to the screen.

These particles now react to lighting in a way that matches the rest of your scene’s illumination—without losing the performance advantages of a camera-adherent GPU pipeline.

2025年10月13日 星期一

Simulating Ghost of Tsushima’s Iconic White Flower Field in Unity

 

I’ve always been fascinated by the vegetation system in Ghost of Tsushima.
After finishing the grass part earlier, I finally decided to tackle the iconic white flower field.