OpenGL demos

Current OpenGL demos

Due to my Vulkan activities I’m not doing much in terms of OpenGL nowadays, but I still do some OpenGL from time to time. If it’s worth releasing, I push it to my open source C++ OpenGL github repository.


Note: Some of these demos have been written more than ten years ago and will most likely no longer work with current hardware, but I left them in here for those who are curious. Also note that the examples are written in Delphi (Object Pascal).

Unreal 1 – Mesh viewer

There are plenty of loaders and viewers for all quake-models (Q1,Q2,Q3,HL) but I haven’t found a single one for the original Unreal’s meshes. So just out of curiosity I wanted to change that and wrote a loader and a viewer that uses OpenGL to render the animated Unreal-Meshes.
Please note that you need to get Unreal Meshes by your own (see the link to the DGL-Thread for more) cause they’re still under copyright and that’s why I didn’t include one into the download.


[OpenGL Shader] (The Tiny) glSlang-Editor

As I was looking for a handy glSlang-Editor and did not found one, I decided to write one by myself that includes some usefull options. So you’ll get this editor with syntax highlighting, help on mouseover for all glSlang-functions and buttons to validate your written shader either via the driver’s glSlang-implementation or via 3DLabs’ tools.


[OpenGL Shader] Water reflections

This uses OpenGL shaders to do reflective water with realistic ripples. The ripples are done using a 3D-Noise (via a pregenerated volumetric texture, as noise isn’t implemented in current hardware), whereas the reflections are achieved through a cubemap. The cubemap by the way shows a 3d-model of a cathedral (kind of “neogyptian”) that I modelled in 3D Studio. Sources are not included. The app also has a small benchmark mode that can be started by pressing ‘d’.


[OpenGL Shader] CEL-Shading and Post-Scene effects

Cel-Shading is realized in this demo (as opposite to the first one) via the new OpenGL-Shaging-Language (glSlang). And besides this, the whole scene gets rendered into a pixel buffer and applied to the whole screen, so that you can also use some shaders for neat post-scene effects. Included in the demo is a ripple- and a fish eye lens-effect.


[OpenGL Shader] Bump mapping

This is an enhanced version of a bumpmapping demo a released some time ago. Besides the fixed function-path, it also contains two new render paths : One for ARB_Vertex_Program plus ARB_Fragment_Program and one using the new glSlang-HLSL. Both new paths run in one pass and also contain specular highlights. The glSlang-renderpath also allows switching between normal bump and offset-bump.


[OpenGL Shader] CEL-Shading

This demo will turn your scene into a comic look, by using a 1D-Texture for color lookup. The lookups are done in a fxPascal-Vertexshader. The demo will render the scene in two passes, first one with shader for celshading and second pass for the outlines.


Vertex buffer objects

This app demonstrates the more recent OpenGL extension GL_ARB_Vertex_Buffer_Object which makes it possible to store vertexdata directly into local VRAM. At first it sounds like a display list but has some big differences. You can for example get a pointer to the VRAM and write or change vertices directly in the VRAM of your graphics card.

The demo shows a huge landscape with about 4 million triangles and will push your graphics card to it’s limits.


Motion blur

This small demo uses the accumulation buffer to simulate a motion blur effect. This buffer allows you to store several renderpasses in it using different blending functions and copying them then back to the frambuffer. This is the easiest way of doing this kind of effect but has the big drawback that except for ATIs Radeon 9500 and up, most consumer cards emulate the accumulation buffer in software. This means that it would be far to slow for a use in games on most hardware.



ATI’s TRUFORM gets nowadays used by some gaming titles to enhance the quality of the playermodels. To see this effect outside of a game I wrote this little viewer for MD2 (Quake2) and MD3 (Quake3) models that enhances those models with TRUFORM. Especially the low-on-poly Quake2-models profit heavy from this hardwarefeature as you can see in the screenshot.
Note: This won’t work on current gen GPUs (even from AMD).



A simple demo that shows how easy it is to tesselate a low-polygon mesh with the GL_ATI_pn_triangles-Extension (also known as TRUFORM) in hardware. The sphere shown in the screenshot only consists of a few vertices and gets tesselated using TRUFORM with only two lines of sourcecode.
To use this demo you’ll need a graphicscard that supports TRUFORM. The following chipsets support it at the moment : Radeon8500, 9500/9600/9700/9800.
Note: This won’t work on current gen GPUs (even from AMD).


Projective shadow mapping

This demo shows how to generate a shadow texture from the light’s point-of-view, using this view’s depth values. This texture then gets projected onto the scene using a special pixel comparsion to set fragments in the shadows to black. Advantage of this method is it’s easy implementation and the fact that objects will shadow themselves.


Projected textures

This demo uses OpenGL’s possibilities to automatically generate texture coordinates to project a texture onto a scene. This then bends around the objects like you can watch it when an object lies in front of an projector. With this effect you can easily simulate effects like projectors or flashlights.



This application was a demo of my first lightmapper. Normally you’ll need to divide your surfaces into many triangles to get correct lighting if you use standard OpenGL-lighting. Lightmapping doesn’t need this tesselation as it calculates a texture with lighting information for every surface and applies this during rendering via multitexturing.
The program loads the lightsources from the file “lights.cfg” and the geometry of the scene from “scene.cfg” and generates the lightmaps upon this data for every quad in the scene.


Vertexarray vs. DisplayList

This small application renders a heightmap based landscape in three different drawingmodes : VertexArray (Key “1”), DisplayList (Key “2”) and as raw triangles (Key “3”) and shows you the speed of every rendermode as frames per seconds. This app is an easy way to show that DisplayLists are best for drawing static geometry.


Render to Texture

Very basic demo that shows how to render to a texture via glCopyTexImage2D(). First the current time is rendered into a small viewport thet gets copied into a texture. This texture is then bound to a rotating quad. This is the easiest method of creating a dynamic texture at runtime.


3 thoughts on “OpenGL demos

  1. Pascal Riekenberg says:


    im just trying to compile your “[OpenGL Shader] CEL-Shading and Post-Scene effects” demo, but glPBuffer.pas is missing. I was not able to find it myself.
    Can you help?

    Pascal Riekenberg

  2. Wayne says:

    Super…. Genau das was ich gesucht habe. Das Projective shadow mapping ist genial… Danke

Leave a Reply

Your email address will not be published. Required fields are marked *