8 comments

[ 0.15 ms ] story [ 43.7 ms ] thread
How do you fake a shader? What does that mean?
You simulate them running in the browser instead of a GPU
You mean the CPU right? Browsers can send commands to the GPU too.
(comment deleted)
It's an HTML canvas, but you can give it input similar to a shading language?
Suggestion

change the line

    `${lib};const {sin,cos,tan,random,PI,sqrt,hypot,atan,atan2} = Math; ${code}; return main;`
to

    `${lib};const {${Object.getOwnPropertyNames(Math)}} = Math; ${code}; return main;

To bring in all of Math into context without having to list them all individually.