rocinantealpha

reference / effects

shade

Fills the shapes drawn after it with a shader of your own, until another fill is chosen: shade "spiral.hlsl", then rect at 0 0 size width height. The shader is an HLSL file in the sketch's assets folder, read again when it changes, and it works out the color of every pixel of the shape from uv, where the pixel is in the shape's box from 0 to 1, and size, the box's size, with time, frame and mouse. by gives it numbers, vectors and colors by name, as for effect: shade "spiral.hlsl" by { arms: 3 }. fill puts a color back.

background 30shade "spiral.hlsl" by { arms: 3, rings: 7, wobble: 0.5, speed: 0, accent: rgb 230 25 25 }rect at 20 20 size 360 260shade "spiral.hlsl" by { arms: 5, rings: 4, wobble: 0.9, speed: 0, accent: rgb 20 90 230 }stroke whitethickness 4circle at 200 150 radius 90
what it draws: the whole window, 400 by 300
What the example of shade draws

How to write it

shade shader [by record]

Related