New Reality Engine (XNA)

Date
Spring 2009
Tech
XNA, C#, HLSL, Xbox 360

Fresh Start

Naturally, version one of anything becomes a lesson in how not to do things, and it's not long until you look upon your codebase with regret as to the monster it has become.

Despite really enjoying OpenGL, I could not help but be curious as to how things were on Microsoft's side of the fence. I wasn't too keen on C++ with DirectX, but XNA just seemed to be a fantastic balance of "here's how you should be doing it" and "the ball is in your court now".

Looking at the screenshots below, you'll instantly notice a drastic improvement of the visuals compared the OpenGL version. The same techinques are being used, but the OpenGL version did not have texture mipmapping enabled, which despite being a detail culling technique, actually causes textures to look grainy and false.

This particular project went as far as terrain, shaders, L-Systems, and Kevin Boulanger's procedural grass technique.

L-Systems

With terrain being procedurally generated, one idea was to take it to the extreme and have the textures, and as many models as possible procedurally generated too. The end-goal would be a game engine that could fill a few MB at most, but display fairly convincing environments.

No, I didn't reach that goal.

L-systems is an algorithm that allows us to generate predictable patterns, such as those you'd find on a typical tree. We draw a tree trunk, then at the endpoint of the trunk, we draw a branch. We then roll back to the first endpoint, and draw another branch at a different angle. We then repeat these steps with some random offsets, and recurse the algorithm, and we soon have the outline of a tree.

That's the theory anyway. Add some rotation offset to make it 3D, play around with the values enough, and the results should be passable.

Variant 1 - each recursion generating smaller steps of branches.
Variant 1 - each recursion generating smaller steps of branches.
Variant 2, with more loops of each step.
Variant 2, with more loops of each step.

Back to projects