Friday, March 12, 2010

Topographic Shader V2 and a happy accident





Ever since I first posted the Topographic Contour shader, I have been trying to figure out how to smooth out the lines in that effect. Eventually I came up with the solution to write a function similar to smoothstep() but instead of smoothly transitioning from 0.0 to 1.0, it transitions from 0.0 to 1.0 back to 0.0 over the same input domain. This was perfect for antialiasing the contour lines! I think this function could be helpful in other areas too..

During the development, I came across a strange shader by accident that was actually pretty interesting looking. I called it Disco Snakeskin and it's the last one pictured above (best viewed large). I think there's potential with that shader.

Lastly, I'm still learning a lot about GLSL every day, and graphics/vector math in general as I do. Screen space derivatives, and fwidth() have been on my mind as I see the power it can bring to antialiasing, and special effects. A new rule of thumb will be for every varying parameter, consider what could be done by looking at its screen-space derivatives. I think some crazy effects are possible with this.. And I'm stoked at the possibility of discovering some of them! In fact, overall I'm really stoked on GLSL. After being involved in graphics coding for so long, finally getting into shaders has been like a rebirth for me- once again learning a ton and feeling low on the totem pole. But seeing some of the things people are doing through this technology is extremely inspiring (and a tiny bit frustrating, I'll admit). With that in mind, I've added a column over there on the right side of the blog, containing any brilliant blogs or sites discussing GLSL.

Thursday, March 11, 2010










Just an update on what I've been working on the last week or two.. The first image shows studies for a music video I'm working on. The video will feature MIDI and audio triggered/modulated 3D forms and all the shader work I've been cranking on. Pictured are some paper cranes and a 'paper' shader, still very much under construction.

The next image shows the multi-light metal/phong shader I've been working on. The results seem really nice, and about exactly what I wanted. Should be a good basis for other shaders too.

The last two images show screen shots from the latest version of CFGR8R program built for live performance with Plaid, the legendary UK electronic duo. Audio reactive environments feature a hybrid OBJ/Generative geometry engine and lots of different dynamic effects. Here you can see the metal/phong shader in action, as well as a fresnel/Xray shader.