If you are familiar with OpenGL you will notice that Vizard has exposed some of the basic texture options to the user. When adding textures you can specify which type of OpenGL texture to create. The most common and default type is a 2D texture. Here is a list of the available texture types:
Texture type flag |
Description |
viz.TEX_1D |
One dimensional texture |
viz.TEX_2D |
Two dimensional texture |
viz.TEX_3D |
Three dimensional texture |
viz.TEX_CUBE |
Cube mapped texture. Composed of 6 textures that represent each side of a cube. Most commonly used for environment mapping. |
viz.TEX_RECT |
Texture rectangle. Same as a 2D texture except that texture coordinates are in pixel values instead of 0 to 1. Does not require image size to be a power of 2. |
For instance, if you wanted to create a Texture Rectangle you would use the following code:
To create a cubemap you would do something similar to this:
Loading all 6 textures for a cube map can become quite tedious, that is why Vizard has a built-in method for loading a cube map. Let's say you have the following textures that represent a cube map:
sky_posx.jpg
sky_negx.jpg
sky_posy.jpg
sky_negy.jpg
sky_posz.jpg
sky_negz.jpg
You could use the following code to load the cube map:
Vizard will automatically add the _posx, _negx, and so on to the end of the texture name and load each into a cube map.
Texture appearance and filtering
Appearance & texturing command table