Ladybug is another nice demo from the guy behind Shadertoy. Like some of his other prods, this multi-pass demo relies on an heavy pixel shader. So heavy that my GTX 1080 struggles a lot to display pixels.
The demo is available in the full code sample pack:
This demo should work on any OpenGL 3.2 capable platform: Windows, Linux and macOS with a decent graphics card. I successfully tested it on Windows 10 + GTX 1080 and on Linux Mint 18.3 + GTX 660.
Oddly (it’s the first time I see that), the demo runs faster on browsers (Chrome, Firefox with WebGL) than on desktop (with OpenGL 3.2 + GeForce 388.43). The mapGrass() and mapMoss() functions in the fragment shader of the buffer A (ps-gl32-buf_A.glsl) are the source of the FPS drop. Here are some framerates of the demo running at 510×290:
Ladybug in Chrome: 52 FPS
Ladybug in Firefox: 38 FPS
Ladybug in Edge: 0 FPS – Not supported 😀
Ladybug in GeeXLab: 27 FPS
iq (the author of this shadertoy demo) has published an overview of the process to code a demo like this one: