Graphics – The Melty Glass Project Intro

7 05 2010

So the subtitle of this blog is ‘Graphics, Photography and whatever’ yet all but 2 of the posts have been about Photography. The main reason I have been telling myself is that most of the graphics stuff I do is rather proprietary and it is hard to separate what I do for work and which parts of that I’m allowed to talk about.

That said I do occasionally engage in my own little projects but they rarely pass the ‘play around’ stage and never get to the ‘show people the code’ stage. Which is a bit stupid because you never get better by not putting stuff out there. And to this end I hope to put some of my experiments up here.

Enter the Melty Glass Project.

In 2008 I had the opportunity to attend WWDC in San Francisco and at the ‘Progresses in OpenGL’ session the man from Apple showed a demonstration of a wine glass that would melt when ‘heat’ from the mouse was applied. And all this on the graphics card.

I was rather taken with this and spent quite a while replicating the effect without access to any source materials. It was fun and the result was cool. And then I lost the source through a series of harddrive failures.

So a month or so ago when I wanted to kick this idea of making little projects off I figured re-doing this WWDC project would be a good starting point. I have since found the original source I wrote so have been able to re-use parts, which is a god-send given how fiddly some of the stuff is.

The basic steps necessary:

  • You create a glass using a surface of revolution with a bezier curve as the profile curve.
  • This needs environment mapping.
  • A nice little shader to give the effect of reflection and refraction.
  • Finally a shader working on the vertex data itself to ‘melt’ the glass.

Thus the point of this post: I’m hoping over the next month to document the work I’ve already done and to finish off the project entirely (it’s already close).

I can’t show you anything from the original demonstration by Apple but here is a screenshot from the original, formely lost, source so you get a sneak peek at the end result:

Preview of Melty Glass




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: