精選文章

SmallBurger Asset Home

  SmallBurger

2025年9月30日 星期二

Building a Cross-Platform GPU Procedural Grass System in Unity URP (Optimized for Mobile)


Recently, I’ve been working on a project called UnityURP-Procedural-DrawMeshInstancedIndirect, and I’d like to share some advantages of procedural generation.

Unlike traditional methods that rely on massive Transform Buffers or GameObject instances, this approach dynamically generates grass using ComputeShaders. For culling, I use a RenderTexture to store results (since SSBOs aren’t supported in many mobile VertexShaders), ensuring compatibility with most mobile devices.

This architecture significantly improves load times and performance, especially on mid- to low-end phones. Let’s break down the key design concepts step by step.

2025年9月26日 星期五

Unity Shader Keywords: shader_feature vs multi_compile — Complete Comparison Table and Usage Guide


Many Unity Shader developers often get confused about the differences between shader_feature and multi_compile, and when to use each one. I’ve encountered similar confusion myself, so I’ve put together this comparison table and practical guide to help everyone quickly understand the correct usage.

2025年9月1日 星期一

Unity Brush Technology: Breakthroughs and Practical Insights — From SetPixels to Compute Shader

During the process of developing a brush system in Unity, I found that in-depth discussions about the “principles of brushes” are quite rare online. Many developers tend to use the engine’s built-in tools directly, rarely exploring the underlying mechanisms. In reality, only by truly understanding how brushes work can we break through the limitations of existing tools and create fully customized brushes tailored to our needs. This is also my motivation for writing this article — to share my technical explorations and practical insights, and to help more people understand and build their own brush systems.

2025年8月12日 星期二

A Hidden Benefit of RenderGraph in Unity 6 URP: Public Access to Core Render Resources


While exploring Unity 6’s URP, I noticed an interesting change: In the 2022.3.x versions, many internal render textures (like m_DepthTexture) could only be accessed via reflection, which was neither convenient nor safe.

2025年7月30日 星期三

Tile3DInstancer: A Practical Solution for Large-Scale, Multi-Type GPU Instancing in Unity


Have you ever run into this when building a large-scale scene?

You used DrawMeshInstancedIndirect to render millions of objects, and at first, it seemed like the perfect solution.

But then, as the number of instance types increased, things got messy. You had to break things up into multiple buffers, issue multiple draw calls—and worst of all, you had no way to know which instances were actually visible.

That means for every type of object, even if it’s not visible at all, the CPU still needs to issue a DrawMeshInstancedIndirect call to the GPU. That’s wasted draw overhead and CPU-GPU communication cost—for absolutely nothing rendered.

And on top of that? You’re manually managing transforms, rotations, scaling, and LODs for potentially millions of instances. Eventually, your scene becomes an unmaintainable blob of dense matrix data.

That’s exactly why we built Tile3DInstancer.

2025年7月22日 星期二

2025年7月4日 星期五

Tile3DInstancer

Tile3DInstancer is built on the core architecture of InstanceCollector (with instance culling and collection handled outside of the same job), and incorporates cell template processing for objects. It can load over 5 million instance transforms in just 2 seconds, while significantly reducing memory usage. I am currently developing an editor for it.