Submitted by , posted on 15 March 2005

Image Description, by

These are some shots from my demo entry to the NVIDIA demo competition held at my University (RWTH-Aachen). It is written in C++ using OpenGL, target platform is a Linux machine with a Geforce6800 although a Windows Visual Studio Project file is included and may work (thanks to Sander van Rossen). I've made some changes after the port so i don't know if it is still working. The demo was developed with all preprocessing tools and all artwork in about one and a half month.

It takes place in some kind of altar/temple, with some bird statue (probably an bald eagle). It features day/night transitions (powertweaked, not realistic). The models are done by myself and my brother. I think modelling was one of the hardest part of the demo (at least for me, having to learn how to master Blender first).

The demo features

a) 3 complete High Dynamic Range pipelines:
  • 64 bit RGBA HDR buffer using GL_ATI_texture_float (bilinear filtered) for Geforce 6800 level hardware
  • 64 bit RGBA HDR buffer using GL_NV_float_buffer and GL_NV_texture_rectangle (no filter) for Geforce 5800 level hardware
  • 32 bit RGBE buffer (no filter, slow) for the ATI Radeon 9700+ (since there is no (working) floating point p-buffer support in the ATI Linux driver) Using tonemapping with automatic adapting exposure based on the average scene intensity and a post process intensity based bloom filter. Also a vignette effect (as seen in the NVIDIA SDK) is included, dimming the resulting framebuffer based on the distance from the center.
  • b) Precomputed Radiance Transfer using Spherical Harmonic Lighting: The lighting is entriely precomputed in a (rather long) preprocessing step. It works by casting rays from each vertex in all directions, accumulating the irradiance of the occluding triangles (works almost like enhanced ambient occlusion). Its not the fastest or most optimal algorithm, but it worked very well and was easy to implement, especially given the very short amount of time available. The BRDF on each face is then approximated by a 3rd order SH. Since it is a Per-Vertex implementation, the triangulation requirement is quite high and about 50.000 faces in the demo. The diffuse distance light can be rotated around at will.

    c) Fresnel term water blending between screenspace refractions and cubemap reflections (only skybox) based on viewing angle. I've implemented a simple fix for a common problem with screenspace refraction, where geometry that is not below the water surface gets refracted as the texture coordinates are bent outside the underwater region. It works by first alpha-masking the water regions. When rendering the refractions, if there is a non-alpha-masked texel, the original (unrefracted) texture coordinate is used instead of the refracted. This works pretty well in my case.

    About the screenshots:
  • The top one just shows the HDR, bloomfilter and spherical harmonic lighting.
  • In the middle left one you can see the global illumination soft shadowing behind the left and right pillar and below the top of the center pillar (with direct illumination it would be all shadowed).
  • The middle right screen shows the water. It's really boring in a screenshot, so better check out the video.
  • The lower screenshot show the day/night transition. While in the left its night with an average intensity of maybe 10^-1, in the right screenshot the light intensity is about 100x times as strong (dawn). This is where you would really see the difference between HDR and LDR, as the LDR image would be all black at night, and probably almost white at day.
  • More info, a video, the full source code (best viewed on Linux with an NVIDIA GFFX+ card) and two other cool demos:

    Comments, critics and questions welcome

    Image of the Day Gallery



    Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
    Please read our Terms, Conditions, and Privacy information.