Category Archives: Programming

Real time procedural water demo

I added procedural water in the “Procedural terrain engine”.

Normally when creating water one often use tiling Du-Dv and Normal textures to create distortion effects and lighting. This is how I did it in the Realization EngineHere I am generating those textures procedurally on the GPU in real time instead. This allows me to adjust diffrent parameters to change the look of the water. It also removes the repeting patterns in the water that are clearly visible when using texture images that are loaded from the disc.

Procedural terrain engine is my own graphics engine I have written In C++ using OpenGL, GLSL and GLFW to experiment with procedural generation of different typs.

Robot and Rocks – game trailer

I worked on this project mostly during this summer with the purpose of learning more about the game engine Unity and game development in general. In the last couple of weeks I have tried to finish all the features I stated to implement, and make a playable game out of it. This Game is also my entry in the annual “LiU Game Awards” competition.

You can download the game and try it for yourself here:

Procedural terrain engine demo

This is a demo I made using C++, OpenGL and GLFW. It is a proceduraly generated landscape in which the user can “walk around”. The terrain is generated using Simplex-noise and is made up of chunks that are loaded and removed as the user walks over the terrain. It is possible to walk infinity (or at least very very far) in one direction without reaching any edge or crashing the program. The chunks are rendered in different levels of detail depending on the distance from the camera to improve performance.

Real time cloth simulation

This is a project I made together with two others students: Mikael Lindhe and Eleonora Petersson. This project was made in the course “Modelling Project TNM085” at Linköping University. The video demonstrates two pieces of cloth that are simulated in two different ways.

The first cloth is represented with particles that are connected with each other using constraints. This mean that whenever the cloth moves, the distances between the particles are corrected to make the cloth retain it’s shape. This is the “usual” method for simulating cloth in computer games.

The second cloth is simulated using a method where the particles are connected with each other using springs. When the cloth moves, forces are applied to all particles to correct them to there original distances from each other.  This method proved to be more computationally heavy and less stable then the first method.

I was mainly working on the graphics part for this project, while the others focused more on the simulation part. It was the first time I developed a basic rendering system for modern OpenGL in C++ from scratch. It was also the first time I made a program that updates vertex buffer data for an object every frame.

Improved world editor in Realization Engine 33

I made a new videon showing how I decorate a small island to demonstrate the new improved world editor mode. Now the user can place any abject as well as moving and rotating them. Objects and also be deleted. The world can be saved to a file from the editor. At startup, the program looks for a save file in the same folder as the executable file, if no save file is found, a default file is loaded. The video also shows some post processing effects I have implemented.

Download an try it yourself:

Mouse cursor ray casting in Realization Engine version 22

I have added a simple editor mode in my graphics engine that allows me to move and rotate entities with the mouse cursor.

This works by casting a ray from the camera, trough the mouse cursor, into the world. To select objects, the distance from the objects local origin to the mouse ray is calculated using linear algebra, if this distance is small enough the object is selected. Then the intersection point between this ray and the terrain is calculated using binary search, and used to position the selected object.

Download version 22 and try it yourself: Realization Engine download page

Double jump using [Space] to begin flying mode. Use space and [Shift] to fly up and down. Hold down [Alt] to free the mouse cursor to interact with objects. Click and drag objects with the left mouse button to move them. Click and drag with the right mouse button to rotate objects. Press the center mouse button to spawn a new “physics-barrel”.

Steam Digger

Steam Digger is a game that I made in the course “TDDD23 Design and Programming of Computer Games” at the university. The game is inspired by an old browser-game called “motherload” the I played a lot when I was a kid. My version is made using Java, libGDX and Box2D. This was interesting to make because if was the first time I used an actual game-library any physics engine to make something. I did not have as mush time as I wanted to spend on this project. There were some features and detailed that were planed, put never added. I think it turned out pretty well anyway. Maybe I will finish this project someday.

Download the game and try it for yourself:

java 2015-10-21 14-22-04-21 java 2015-10-21 14-28-40-35

FPV Quadcopter Racing Simulator version 2

Version 2 of my FPV Quadcopter Racing Simulator adds soundeffects. I have also placed a number of gates around the world to fly trough, and added more trees and grass and flowers to make the world more interesting. In this video I fly using an xbox360 controller, but it should work with any controller, including real “RC simulator transmitters”.

Download version 2 here and try it for yourself (requires decent gaming grade graphics card): FPV racing quadcopter simulator download page

Particle systems in Realization Engine

Version 19 of my graphics/game engine project demonstrates particle systems with fire, smoke, falling leaves, and snow. All entities (objects) also support normal maps. This makes it possible to make rough and uneven surfaces look more realistic. There is also multiple skyboxes that can be faded and mixed independently. Watch the video or try it yourself:
Realization Engine downloads page
Realization Engine project page

Water rendering in Realization Engine v13

In update 13 a have added water to the world. The water is created using a reflection texture and a refraction texture that are applied to the water surface. The textures are distorted and animated by two DuDv maps. There are also specular light reflections on the surface, the surface normal is calculated using two normal maps.

More info here: