Shadertoy progress and the state of OpenGL in Perl

Ultra Liquid Bokeh Shadertoy The shader is a modification of a shader by Inigo Quilez, hacked up by Weyland.

After the initial rush of success, I spent this week working more on the UI side of the app, putting off adding support for geometry generation for later. Prima proves to be a solid UI toolkit and to me it feels closer to using Delphi or Visual Basic, API wise.

The application now quits when the Escape key is pressed. F11 brings the program to fullscreen mode. There now is a section of the window where the current frame rate is displayed. The program can now save a screenshot to a PNG file, thanks to Imager.

Dimitry has been very supportive in updating Prima::OpenGL with my changes. Prima itself has proven a very portable and convenient UI toolkit across Windows and Linux. It installs from CPAN without needing additional libraries prebuilt on the local machine. I hope that Prima gets more traction as a UI toolkit, as it contains many interesting widgets and also has a UI builder that feels very much like the Visual Basic or Delphi UI builder.

On the OpenGL side of things, I am amazed that the code I wrote already works across Windows and Linux. Adventurous people have downloaded and installed the Github repository and they gave me feedback that everything Just Works. I am in contact with the OpenGL developers and our roadmap is to bring the code that currently lives under the OpenGL::Glew name into mainline OpenGL as soon as it proves stable enough. To get exposure to the CPAN testers, we will release some developer releases which hopefully smoke out all the portability niggles that usually show up when distributing C libraries.

For the weekend, if you feel like looking at pretty pictures and running shaders as your screensavers, please clone the Github repository, compile OpenGL::Glew and report back how it worked out for you:

git clone https://github.com/Corion/app-shadertoy.git
cd app-shadertoy
cpanm --installdeps .
perl Makefile.PL
make
perl -Mblib scripts/shadertoy.pl shaders/ultra-liquid-bokeh.fragment

On Windows, you will need to switch make to dmake.

1 Comment

Hi Max, this is Dmitry (the movable type locked my account).

The shadertoy is really impressive!

btw You can also use Prima::Image for image
save/load, and also various pixel and geometry transforms.

Leave a comment

About Max Maischein

user-pic I'm the Treasurer for the Frankfurt Perlmongers e.V. . I have organized Perl events including 9 German Perl Workshops and one YAPC::Europe.