Sunday, July 08, 2012

Sphere imposters in OpenGL shading language

I recently started a hobby project to create a little OpenGL viewing application. I am experimenting with custom shaders to create sphere imposters. It's working pretty well. Here is a caffeine molecule.

Each sphere uses only two triangles; compared with the thousands of triangles that would be needed to get similar smoothness with the classic OpenGL pipeline.

This week I implemented the custom shaders and various stereoscopic viewing options.  Next I intend to implement interpolated fly-through movie making, and then upload a 3D video to YouTube.

I should also work on measuring and improving performance like I did with my earlier sphere rendering project.  Performance is sluggish when I try to view a protein with thousands of atoms.  But there is a lot of room for improvement.

Four of the five sphere below use the fixed-function OpenGL pipeline, and have hundreds of polygons each.  One sphere has two triangles and uses my shaders.  Can you tell which one?

My inspiration for this sphere imposter project was QuteMol.  I am a long way from achieving what those guys did.  But I am proud of what I have done so far anyway.

1 comment:

Виктор said...

Hi there. I hope you will read this. I found you blog while searching on how to work with OpenGL in Python.
I'm working on small app, which is capable to show me the atomic structure in 3D (with mouse controlled rotation and so on) and also can convert some file formats to another. This would be very useful for my daily needs. I'm not planning any kind of distribution, except for my supervisor.
I wonder if you already done the opengl representation part and could help me with it or share the code. I've checked many projects in internet, but they do not allow to embed the window inside.

Please contact me by email.
With best regards,