Shadertoy-Shaders/John-Conway's-Game-of-Life:2D/Common.glsl

16 lines
339 B
Plaintext
Raw Normal View History

const float GRID_PIXEL = 75.0;
// how many frames to ignore when computing next iteration of game of life.
// Frame-Rate = fps/FRAME_INTERLACE
const int FRAME_INTERLACE = 10;
// pixelize
float pixelize(in float x)
{
return floor(x * GRID_PIXEL)/GRID_PIXEL;
}
vec2 pixelize(in vec2 x)
{
return floor(x * GRID_PIXEL)/GRID_PIXEL;
}