openage builds contain several interactive renderer tech demo entrypoints that show of specific features.
These demos are also useful for learning the renderer API and for testing new functionality. In addition to
the demos, there are also stresstests that are used to test the performance of the renderer.
The source code for renderer demos and stresstests is located in libopenage/renderer/demo
.
This documents describes the purpose of each demo and contains instructions on how to interact with them.
This demo shows the creation of a minmal renderer setup and the rendering of a simple mesh.
The demo initializes a GUI application, a window, a renderer object, and a render pass. It then loads a shader program and creates a single mesh object which is then rendered to the screen using the shader program.
The demo mostly follows the steps described in the Level 1 Renderer - Basic Usage documentation.
./bin/run test --demo renderer.tests.renderer_demo 0
Result:
This demo shows how simple textured meshes can be created and rendered. It also demonstrates how to interact with the window and the renderer using window callbacks.
./bin/run test --demo renderer.tests.renderer_demo 1
Controls:
- LMB: Click on the textured meshes to get a debug message with the object ID.
Result:
In this demo, we show how animation and texture metadata files are parsed and used to load and render the correct textures and animations for a mesh.
./bin/run test --demo renderer.tests.renderer_demo 2
Controls:
- LMB: Click on the sprite to get a debug message with the object ID.
- ←: Go back one frame in the animation.
- →: Advance the animation by one frame.
Result:
This demo shows a minimal setup for the Level 2 Renderer and how to render objects with it. The demo also introduces the camera system and how to interact with it.
./bin/run test --demo renderer.tests.renderer_demo 3
Controls:
- W, A, S, D: Move the camera in the scene.
Mouse Wheel
: Zoom in and out.
Result:
This demos shows how animation frame timing works and how to control the animation speed with the engine's internal clock.
./bin/run test --demo renderer.tests.renderer_demo 4
Controls:
- Space: Pause/resume the clock.
- +, -: Increase/decrease the simulation speed.
- Return: Toggle between real time and simulation time.
Result:
This demo shows how to create uniform buffers and how to use them to pass data to shaders. Additionally, uniform buffer usage for the camera system is demonstrated.
./bin/run test --demo renderer.tests.renderer_demo 5
Controls:
- W, A, S, D: Move the camera in the scene.
Result:
This demo shows how to use frustum culling in the renderer.
./bin/run test --demo renderer.tests.renderer_demo 6
Controls:
- W, A, S, D: Move the camera in the scene.
Result:
This stresstest tests the performance when rendering an increasingly larger number of objects.
./bin/run test --demo renderer.tests.stresstest 0
Result:
This stresstest tests the performance when frustum culling is enabled and an increasingly larger number of objects is rendered on the screen.
./bin/run test --demo renderer.tests.stresstest 1
Result: