Skip to content

Latest commit

 

History

History
26 lines (9 loc) · 769 Bytes

File metadata and controls

26 lines (9 loc) · 769 Bytes

Unity Compute Shader Samples

I keep forgetting how to setup compute shaders in Unity and keep searching sample code from my previous projects. This is a collection of code that I keep coming back to bind Render Textures or Structured Buffers. There are currently 3 samples:

Basic Setup

I remember first time creating a compute shader and not knowing what to do with it. This sample shows how to create and bind a render texture to compute shader and to render it.

Procedural Points

An example to position points in a compute shader and render them procedurally.

2D Particle Trail

An example of manipulating a render texture in every frame. Particles are moved in each frame and leave a trail.

I hope these samples will help someone!