Demonstrates usage of cube map textures and texture blending.
Simulates open world with two tarnish reflective spheres in front of the camera. This example also demonstrates usage of scene graph, resource manager and pre-made primitives.
The application tries to load cube map texture from the directory in which it is run. Cube map texture consists of six JEPG files
-z.jpg, each representing one side of the cube. Note that all images must be turned upside down (+Y is top):
+----+ | -Y | +----+----+----+----+ | -Z | -X | +Z | +X | +----+----+----+----+ | +Y | +----+
You can also pass file path prefix to the application as parameter, for example
The application will then load
~/images/city-x.jpg etc. as a cube map texture.
Sample cube map files are supplied alongside the source. If you install the examples, the images are also copied into
<prefix>/share/magnum/examples/cubemap/. Running the example with the bundled files can be then done like this:
Arrow keys rotate the camera around the spheres. It is not possible, due to nature of the cube map projection, to move around the scene.
Full source code is linked below and together with assets available in the magnum-examples GitHub repository.