Avogadro and GLSL

Last night I finally found a little time to look at GLSL shaders and how best to integrate some into Avogadro. I had been meaning to do this for quite some time but there is always so much to do and so little time! First problem I had was actually accessing the functions to use GLSL shaders. In the end I found a great little library called GLEW that lets me test for OpenGL 2.0 and then ensures all the functions are available.

Avogadro rendered atoms without any special shadersAvogadro rendered atoms with an OpenGL 2.0 phong shader

Both of the images were rendered using medium quality. The one on the left is not using any GLSL shaders and the one on the right is using a phong style GLSL shader. I am not sure it is very optimised, and right now the code needs cleaning up a little before I can commit it. I think it is another great option to use on higher end systems while maintaining compatibility with older systems.

Hopefully I will have more time to play with shaders soon. I wrote a flattening shader that looks pretty cool too. I think that shaders introduce a level of flexibility to our rendering pipeline but I have so much to learn. Being able to effectively ray trace on the GPU is great!

Share Comments
comments powered by Disqus