Last active
February 1, 2020 19:53
-
-
Save ancillarymagnet/80ed0cacb4332a8731592d988a1fc16e to your computer and use it in GitHub Desktop.
CCA_compute_020120v01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma kernel ResetKernel | |
| #pragma kernel StepKernel | |
| Texture2D<float> readTex; | |
| SamplerState sampler_readTex; | |
| RWTexture2D<float> writeTex; | |
| RWTexture2D<float4> outTex; | |
| int rez; | |
| /* | |
| * | |
| * | |
| * RESET | |
| * | |
| * | |
| */ | |
| [numthreads(1,1,1)] | |
| void ResetKernel(uint3 id : SV_DispatchThreadID) | |
| { | |
| writeTex[id.xy] = 0; | |
| } | |
| /* | |
| * | |
| * | |
| * STEP | |
| * | |
| * | |
| */ | |
| void Render(uint3 id, float state) | |
| { | |
| outTex[id.xy] = state; | |
| } | |
| [numthreads(1,1,1)] | |
| void StepKernel(uint3 id : SV_DispatchThreadID) | |
| { | |
| writeTex[id.xy] = readTex[id.xy] + .1; | |
| Render(id, writeTex[id.xy]); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment