distraction/shaders/default.py
2020-02-12 13:11:57 +01:00

11 lines
334 B
Python

import math
from pixel import Pixel
def main(pixel: Pixel, resolution: tuple, frag_coord: tuple, time: float):
uv = (frag_coord[0] / resolution[0], frag_coord[1] / resolution[1])
pixel.background_color.set(
0.5 + 0.5 * math.cos(time + uv[0]),
0.5 + 0.5 * math.cos(time + uv[1] + 2),
0.5 + 0.5 * math.cos(time + uv[0] + 4)
)