DenizBicer / UnityComputeShaderSamples

Basic samples to use compute shaders in Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!

About

Basic samples to use compute shaders in Unity


Languages

Language:C# 77.9%Language:ShaderLab 22.1%