GLSL Post-processing system

Put the farm game on the shelf for a while because uni’s back.

I spent all weekend making a easy to use post processing system for OpenGL. Basically, I am drawing my entire scene to a FBO, then drawing a fullscreen quad with the FBO as the texture to a different FBO. Then I draw that FBO as a full screen quad to another FBO, rinse and repeat until all effects have been applied. The system uses a list of effects which means you can stack shaders to combine effects.

Usage:

//Setup code
PostProcessor pp( screenW, screenH );
Shader* shader1 = new Shader();
shader1->loadVertexShader(   "file.vert" );
shader1->loadFragmentShader( "file.frag" );
shader1->compileShader();
pp.addEffect( shader1 );
//Main game loop
pp->stopRendering();
	//All scene rendering code to go here
pp->stopRendering();
//Draw the final screen
pp->drawProcessedScreen();

Easy as!

Here are some screenshots of various shaders:

I have collision!

I finally got around to implementing the collision detection on the terrain:

Didn’t give me too much trouble. Basically what I’m doing is feeding it an x and a z coordinate, the tile is determined, and then the specific polygon from that tile is determined. I then calculate the polygon normal and give it to my ray-plane collision detection function I created. Then it gives me the point where the ray intersects with the plane of the polygon!

Fixed my terrain normals

I spent all day slacking off watching Freaks and Geeks!

Anyway, the normals on my terrain finally bugged me enough to fix them. I always thought they were just a BIT off. So I had a quick look through and found out I was adding the up vector to my normal calculations – Doh!

That’s my 2 minutes of coding done for today:

WIP2Finally got some nice shadows going.

Farm game progress…

Got some time to work on my farm game… Got different tiles / textures working.

WIPCollision detection next I guess.

Textured

WIP4

Got my terrain textured.. Actually I will soon have to untexture it and implement tiles with different textures on them, and then optimise the rendering calls.

Farm Game

I’ve dropped my OSG pool game for a while. This is 100% due to a ridiculous lack of documentation!

Anyway, sorry for not posting lately. I havn’t been doing much programming because I couldn’t decide what to do. But now I’ve got my mind set. I’m going to make a fun farm game. It will be a mix between harvest moon and wurm online. With deformable terrain!

I just got the base of my terrain class down a few minutes ago. The normals are automatically generated!

WIP1

WIP2

I’m using pure OpenGL for the game. I’m also using and adding to my openGL lib GameFrame as I work on it and refine things. I have actually got the base of my own scene graph implementation layed out but I wont be using it for this game as there is no real need for a scene graph.

Pool Game Update

Added textures and quaternions so the balls can roll now!

Screenshot

Screenshot

Pool Game Progress:

Got it off the ground today, here’s proof:

WIP2

Obviously still got to do the wall and pocket physics.

Pool Table Model WIP

I actually decided to spend tonight modelling the proper pool table (scratch that last post lol). Here is the result so far:

It’s sitting at about 16k polys with 2 mesh smooth iterations. I know it seems like a lot of polygons for a table, but it’s pretty much all the game is going to be rendering. Except maybe a room backdrop. So it might aswell look nice!

I still have to model the base, optimise it and texture it.

Pool Table Placeholder

Quick Model

Quick Model

I threw this together last night as a placeholder for the real, more detailed pool table which I’ll make later. As usual I spent way too much time on something which is just meant to be a placeholder. This screenshot is from within the very base of my game. Currently its pretty much OSG doing all the loading and rendering work. You can swivel around it like a trackball aswell. It’s actually really easy to setup this scene to a reasonable degree thanks to OSG.