Making a Shader Thing
I was in want of some little utility program for testing rendering jitter and
judder. There are websites dedicated to this such as testufo.com and
they have the right idea; i.e. that we humans (at least some of us) can quite
easily detect skipped frames in an animation with side-to-side movement. I’ve
been using weston-simple-egl
up to this point, which renders a rotating
triangle. It’s easy to see when frame skipping gets very bad, but occasional
frame drop is very hard to see with this rotating motion.
I started by creating a simple shader in Shadertoy that draws some sine waves with a time dependent phase shift and that looks fine, but my browser struggles with smooth rendering and I definitely do not want to find myself wondering if my measuring instrument is giving me accurate results. A browser is a very large and complex beast and can’t really be relied upon for instrumentation, so I wrote the simplest thing possible in C for achieving the task at hand and Shader Thing was born.
Shader Thing is a small command line utility that renders a GLSL fragment shader into a window. It can run some shaders from Shadertoy and glslsandbox.com with some modifications. I put very little work into this tool, but I’m making it public in case anyone else might find it useful.