I’ve been working on a new OpenGL program. Didn’t finish the last one as I decided I wanted to make a portable application (ie, so I can port it to Windows, and possibly even DirectX one day). Only a touch of Objective-C/Cocoa to set up the windowing and use some nice OS specific functions (such as Cocoa automatically being able to decode PNG files), most of it is written in C++
So I’ve been playing around with VBO’s (Vertex Buffer Objects) and FBO’s (Frame Buffer Objects) which I had been doing in the previous program, but it turns out I was doing it slightly wrong. So now that it’s all working correctly I have a bit of an app going.
Currently it pretty much only loads Obj models (a simple ASCII based format), but most 3D applications will export this.
Underneath there is a lot going on. It has:-
Next things I’d like to do are is have a model manager to allocate one (or more) large VBO on the card to hold lots of smaller models and index them within the VBO, more shaders – I’d really love to try some SSAO (Screen Space Ambient Occlusion – basically simulating the way that indirect light will still light and shadow things) and deferred lighting/shadowing and write a full GUI for it for things like menus, combo boxes, buttons, etc.
I’m sure I’ll come up with a lot more, possibly turning it into some type of game engine one day.
Here’s a screenshot of what I have so far.
It doesn’t look like much, but there’s a lot of work going on there.
The colours you can see on the model (which I actually made myself) are what’s known as a normal map. It’s the way lighting is calculated on 3D models.
Unfortunately there’s a couple of problems with this model.
One thing that may stick out in that screenshot too (at least if you click it and view it in full size) is that the frame rate is only 20FPS. Basically there are three reasons for this:-
So next post, I’ll hopefully show a proper render of the model. Maybe even throw in a quick tutorial on VBO’s (which are really quite easy when you get your head around them).
Ok, so this is what I’ve been working on recently. I know there’s a few of these out there, but I’m more doing this to learn shaders for myself (along with VBO’s – Vertex Buffer Objects – and FBO’s – Frame Buffer Objects) along with Objective-C/Mac programming.
So what you’re seeing there is a slight Gaussian blur on the texture itself and a radial blur on the whole scene itself (using an FBO mapped onto a Quad that fills the screen).
As you can see on the right, it has a built in editor. It will eventually have syntax highlighting, but I had to disable that temporarily as it was causing some issues.
So, have a couple of updates for this today. Firstly, I have a very cool girlfriend. For our anniversary (2 wonderful years), she bought me this:-
How awesome! Two of my favourite things, Star Wars, and lots of female flesh
Secondly, I’ve picked myself up a new MacBook Pro
It’s just the base model of the pro’s, but it’s absolutely awesome. Idealy I want to write apps for both the Mac and for the iPhone.
I’m still going through an learning Objective C/Foundation libraries. Getting there slowly. I think the hardest bit for me to get my head around is using the Interface Builder to link my classes to the ui. A very different style to what I’m used to, and not sure if I like it yet or not. I’m all happy with the speedy creation (even if it does feel a bit like cheating), but I’m not a fan of not having actual code behind it for future flexibility. We’ll see how restrictive it is though.