This file contains 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
[numthreads(1, 1, 1)] | |
void StepKernel(uint3 id: SV_DispatchThreadID) | |
{ | |
// READ STATE | |
uint state = readTex[id.xy]; | |
uint count0 = 0; | |
uint count1 = 0; | |
uint count2 = 0; |
This file contains 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
neighborhood0 = new Vector4[] { | |
new Vector4(-1,-14), new Vector4(0,-14), new Vector4(1, -14), | |
new Vector4(-4,-13), new Vector4(-3,-13), new Vector4(-2, -13), new Vector4(2,-13), new Vector4(3,-13), new Vector4(4, -13), | |
new Vector4(-6,-12), new Vector4(-5,-12), new Vector4(5, -12), new Vector4(6, -12), | |
new Vector4(-8,-11), new Vector4(-7,-11), new Vector4(7, -11), new Vector4(8, -11), | |
new Vector4(-9, -10), new Vector4(9, -10), new Vector4(-1,-10), new Vector4(0,-10), new Vector4(1, -10), | |
new Vector4(-10, -9), new Vector4(10, -9), new Vector4(-4,-9), new Vector4(-3,-9), new Vector4(-2, -9), new Vector4(2,-9), new Vector4(3,-9), new Vector4(4, -9), | |
new Vector4(-11, -8), new Vector4(11, -8), new Vector4(-6,-8), new Vector4(-5,-8), new Vector4(5, -8), new Vector4(6, -8), | |
new Vector4(-11, -7), new Vector4(-6, -7), new Vector4(-2, -7), new Vector4(-1, -7), new Vector4(-0, -7), new Vector4(1, -7), new Vector4(2, -7), new Vector4(11, -7), new Vector4(6, -7), | |
ne |
This file contains 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
// Reset | |
#pragma kernel ResetTextureKernel | |
#pragma kernel ResetAgentsKernel | |
// Step | |
#pragma kernel MoveAgentsKernel | |
#pragma kernel WriteTrailsKernel | |
// Render | |
#pragma kernel AgentsDebugKernel |
This file contains 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
// Reset | |
#pragma kernel ResetTextureKernel | |
#pragma kernel ResetAgentsKernel | |
// Step | |
#pragma kernel MoveAgentsKernel | |
#pragma kernel WriteTrailsKernel | |
#pragma kernel DiffuseTextureKernel | |
// Render |
This file contains 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
// | |
// Handles browser window resizing, with a delay to avoid constant resizes | |
// | |
var resize = { | |
time: 0, | |
delay: 300, | |
handled: true | |
} |
This file contains 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
var resize = { | |
time: 0, | |
delay: 300, | |
handled: true | |
} | |
var circleDiameter; | |
function setup() { | |
let s = min(window.innerWidth, window.innerHeight); |