So, you guys saw a still like this from the last time I posted. Basic OpenGL stuff with a couple lights and some simple cube-like structures. Immediately after getting that far, I wanted to get this stuff rendered in Sunflow. Now, Sunflow is an open-source global illumination renderer built with Java. But at it’s core it’s a ray tracer, which basically means you’ve can make stuff that looks real because it simulates real light rays. Moreover, it has different kinds of cameras… and one of those cameras can render a pretty realistic depth of field and even bokeh.
Here’s the thing, I’m working in Cinder, which means I needed to write something that took my geometry and dumped out a Sunflow Scene File (.sc). But first, I had to figure out how the hell to get the OpenGL viewport projection matrix mapped correctly to the Sunflow camera — and moreover, I had to figure out how to take all these OpenGL transformations (rotate, translate, etc.) and turn them into something Sunflow understood.
Today, I finally wrapped my head around the two main OpenGL matrices. I’ll go into the specifics for folks that are interested in a later post, but the point is this: I can write code and render stuff using OpenGL in Cinder, press a key, and dump out all my Sunflow Scene File data (to the console for now).
Here’s what the above image looks like when it’s rendered with a couple point lights and a pinhole camera:
And here’s what it looks like with ambient occlusion (and no point lights)!
And here’s what happens when you play with the Phong shader and too many lights and don’t want to tweak things until they actually look good!
All of this has me excited because now I can move quickly with framing and general colors and textures and such in OpenGL, then get super-nice renders from Sunflow. Yay open-source!