[–] CppPro 1y ago ↗ How do you fake a shader? What does that mean? [–] __m 1y ago ↗ You simulate them running in the browser instead of a GPU [–] ImHereToVote 1y ago ↗ You mean the CPU right? Browsers can send commands to the GPU too.
[–] __m 1y ago ↗ You simulate them running in the browser instead of a GPU [–] ImHereToVote 1y ago ↗ You mean the CPU right? Browsers can send commands to the GPU too.
[–] Lerc 1y ago ↗ Suggestionchange 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. [–] Lerc 1y ago ↗ Maybe also adding smoothstep and clamp as traditional shader building blocks functions.You can still define them in inline with not too many characters though so maybe it's ok.https://garten.salat.dev/fake-shaders3.html#Zy5kaW09NjQ7bGV0... [–] eddyflux 1y ago ↗ wow that's cool
[–] Lerc 1y ago ↗ Maybe also adding smoothstep and clamp as traditional shader building blocks functions.You can still define them in inline with not too many characters though so maybe it's ok.https://garten.salat.dev/fake-shaders3.html#Zy5kaW09NjQ7bGV0... [–] eddyflux 1y ago ↗ wow that's cool
8 comments
[ 0.15 ms ] story [ 43.7 ms ] threadchange the line
to To bring in all of Math into context without having to list them all individually.You can still define them in inline with not too many characters though so maybe it's ok.
https://garten.salat.dev/fake-shaders3.html#Zy5kaW09NjQ7bGV0...