PhD 3D Engine PDF Print E-mail


In this article, I describe the 3D engine I have developed during my PhD thesis. At the beginning of my PhD thesis, I knew it would require a lot of experiment to be conducted in order to study user's gaze behavior during first-person navigation in VE. Therefore, at the beginning of my PhD, I decided to take the time to develop a small and simple-to-use 3D engine. "Why not using an existing engine you fool?" will you say. Well,  I needed specific control over specific data about the world as well as its entities, post-processes, the way I was going to build the levels and record the experiment sessions, etc. Also, I am a developer who like to implement things and learn! And I knew I would learn a lot in developing this engine.

Engine capabilities

After roughly one month of full-time development (june 2008), I ended-up with a pretty nice engine! Concerning the graphical capabilities of the engine, here is a list of what it is and can do:

  • Forward renderer (z-preprass + light accumulation)
  • Maps are designed under Maya2008 and exported in my own format using an exporter I have developed
  • Lighting pipeline:
    • Direct lighting is computed for point and spot light with or without shadow. (diffuse+specular)
    • Thanks to a nice MentalRay feature: indirect illumination baked in a HDR lightmap as a single color (no spherical harmonics nor valve basis: I should have bought Beast for this)
    • HDR and simple luminance adaptation
  • Phong material only:
    • normal
    • diffuse
    • specular color and power
  • Lights have the same appearance in the engine as when rendered with MentalRay
    • transformation, color and intensity
    • Decay rate forced to be quadratic
    • penumbra, cone angle
    • Drop off
    • Point light and shadow mapping: use of the virtual-indirection-cube map method
    • All lights are rendered using the same method. However, lights loaded from the map file should not be moved to stay coherent with the lightmap.

The engine also features:

  • Scripting using LUA (with registred C class like vector3, transform, entity, etc)
  • Record the navigation and actions of the user. Recording is achieved using an event system.
  • Exact replay of each frame (no interpolation): this is important to analyze data on the same images users saw.
  • nVidia Physics (guess what for?)
  • Gaze-tracking. Supports Tobii x50 and my own webcam based gaze tracker. More trackers can be easily added by implementing a single interface class.

In the end, this project was very satisfying. I consider it successful as I have used this engine during my whole PhD thesis. Of course, it went through several bug corrections and improvements over the time but it has been done naturally. If you are interested in the code, do not hesitate to send to me an email. If I found the time to properly comment the code, I may release it here.


A map edited in Maya2088

The final result rendered in real-time


Gaze-based colored stochastic shadow mapping implemented in the engine

Gaze-based depth-of-field blur effect implemented in the engine


A game I needed for an experiment. It has been developed only by modifying the Lua script file. The goal here is to look at the tie-fighters in order to destroy them. Be careful to keep your allies alive!


The engine is able to render simple and complex environments. The most complex environment (A) involves a lot of scripting like moving robot with attached light, sliding doors, animated mechanic stuff, flickering lights, physical barrels, etc.


==> A video of Q3DM1 rendered in my engine with a static light map (no dynamic lights excepted the flash light).


I would advice all PhD student to sit down and think about the tools they are going to need and that could make their life easier later. I have spent a little bit more than one month working on this engine (+ updates) and not doing research but it was worth the cost. It allowed me to quickly:

  • design my experiments using scripting
  • build environments under Maya+MentalRay
  • record user's actions in the VE
  • extract meaningful data for analysis

I have to say that, like every engines out there, it is not perfect. Firstly, It is not based on Data-Oriented-Design but Object-Oriented-Programming. This is not such a big concern here since I did not target maximum performance on multi-plate-forme. Secondly, there is no smart data structure to help culling as I did in my previous engine. There is no portal nor PVS: only frustum culling. However, because I knew my test environments would remain small, I never ended up having frame rate trouble. Everything was rendered between 30 to 60 fps. Last, the Maya exporter is not well integrated. You have to follow strick rules like texture coordinates naming convention, only one lightmap texture, only polygons, only static geometry then dynamic entities are spawned using scripting...
Despite these flaws, I really think that this engine is a success as it allows me to conduct all my experiments, analyze the results, print nice screenshots for papers and get my PhD thesis in hand! :)

Last Updated on Sunday, 17 July 2011 19:05