Expert content on rendering and optimization in Unity.
New insights every week.
Featured articles
Stateless particles - rendering without a mesh
Rendering effects without CPU mesh handling. Creating particle meshes on the fly in the shader code. Implementing a tornado VFX and making it run 13x FASTER.
Terrain hack: Fastest erosion algorithm ever
This is the fastest, and the simplest terrain erosion algorithm I've tried. Explained in detail.
Tutorial
This will rewire how you think about rendering optimization. This is a deep dive.
My mental model of a GPU that I use every day to reason about rendering, profiling and choosing the right optimization path.
I made this shader run 5x faster
I optimize one of my old fragment shaders to run 5x faster, keeping visuals almost unchanged.
Learn in one minute
Resolution and format of a texture affect your shader's performance
When you ask for one value from RAM, the CPU grabs a block of nearby data (a "cache line") and moves it to a faster memory, expecting you'll need that soon.
GPUs do something similar. When you sample a texture, the GPU doesn't just load the requested texel - it fetches a small block of nearby texels and stores them in fast memory (L1 or L2 cache), so future reads are quicker, as long as they are close to each other.
#01
Higher resolution equals more cache misses and less efficiency.
#02
Sample fewer textures for better speed.
#03
Mipmaps improve cache use by lowering texture detail for smaller objects.
#04
Instruction count doesn't reflect performance, like lines of code don't show function speed.
#05
Random UVs, triplanar mapping, or marching are slower than standard texturing.







