PFC: OpenGL Simple Engine

My final career project was to represent fluidly in 3D space an IOM (Individual Oriented Model). Specifically a fish school representation.

An IOM is a mathematical model that simulates the behavior of a set of individuals. Such behavior is obtained from the interaction of each individual with the rest. The problem with IOMs is the high computing capacity needed for solving them. Just think about an IOM of a set of 1.000.000 individuals, where each individual’s behavior is calculated through the actions of nearby individuals (neighbors). It’s quite complex. Well, now add the complexity to display all of this in a 3D environment. Funny uh?

The challenge was create a fast renderer, ergo a renderer that showed the full set with nice FPS.

I programmed the core before the deadline so I had more time to implement upgrades:

  • I added a ‘var console’ thus I could change any environment variable as I wish. The inspiration of that feature came from Quake. In fact the variables had a similar format with Quake variables (r_fishDetail, r_showFPS, …).
  • I coded an external program in .NET to setup the environment of the renderer.
  • I implemented collision algorithms, frustum culling and simple physics for the point of view (camera). I was bored, so in addition I implented too special moves to the camera (run, jump, fall, and strafe jumping).
  • Last but not least, I design a script reader that interpreted shaders (texture effects)

For example the strafe jumping:

Shader scripts would be like these structure. The renderer was responsible of read and execute them with the OpenGL ARB extensions:

sea1/flame1.jpg
{
	TEXTURE_NUMBER 1
	TEXTURE1
	{
		NAMEflame1.jpg
		OPACITY 0.9
		BLENDFUNC 2 GL_SRC_ALPHA GL_ONE
		VELOCITY_SEC 0.1
		SEC 8 flame1.jpg#flame2.jpg#flame3.jpg#flame4.jpg#flame5.jpg#flame6.jpg#flame7.jpg#flame8.jpg
	}
}

In the next video you can see and environment with shaders, and later the same one without them:

This entry was tagged as , , ,

Leave a Reply

Your email address will not be published.