Code golfing a tiny demo using maths and a pinch of insanity

  • I don't know much about 3d stuff or shaders or this language, but I know golf, and I think I found a byte to save.

        w = g-g*exp(-mix(h*3e2,d*2.5,a=h<.001?0.:1.))
        w = g-g/exp(mix(h*3e2,d*2.5,a=h<.001?0.:1.))

  • Using maths, insanity, and a ton of calculation horsepower... That made my graphic card fan turn on instantly!

  • If anyone is interested in learning more about this kind of coding https://thebookofshaders.com/ is a fantastic intro.

  • The top demo doesn't function on Edge or Chrome on Windows due to too many webgl contexts.

    > WARNING: Too many active WebGL contexts. Oldest context will be lost.

  • Unbelievably cool, well done!

  • Another two bytes found (I think)

      (d==0.?K*.01*h:c-c)
    
    could become

      (d>0.?.0:.01)*K*h

  • This is utterly bonkers to me, well done.

  • Needs dragons flying sunwards