|
|
The skybox will be rendered using a fixed-function shader program with the environment cube texture only. Additionally, the depth test and depth writes will be turned off when the skybox is being rendered. This is because it is assumed that the skybox will always surround the entire scene and there is nothing behind it. You can use this to your advantage by never clearing the color buffer explicitly every frame and rendering the skybox instead to effectively "clear" (or better set) the color buffer.
Public Member Functions | |
| Skybox (real edgeLength, const boost::shared_ptr< CubeTexture > &pEnvironmentMap) | |
| Constructs a new skybox that uses the given environment map. | |
| boost::shared_ptr< RenderContext > | GetRenderContext () const |
| Returns the render context used by this skybox. | |
| void | Render (const Vector3 &cameraWorldPosition) |
| Renders this skybox. | |
| real | GetEdgeLength () const |
| Returns the edge length of this skybox. | |
| const boost::shared_ptr< CubeTexture > & | GetEnvironmentMap () const |
| Returns the environment map used by this skybox. | |
|
||||||||||||
|
Constructs a new skybox that uses the given environment map. |
|
|
Returns the edge length of this skybox. |
|
|
Returns the environment map used by this skybox. |
|
|
Returns the render context used by this skybox. |
|
|
Renders this skybox. Note that the skybox automatically centers itself on the given world position, which should be the world position of the currently used camera. Thus any translations in the world matrix are ignored and the skybox is instead translated so that its local origin coincides with the camera position. Orientations of the world matrix, however, are applied. Also note that the skybox is rendered with the depth test and depth writes turned off. The depth buffer state is restored to what it was before after the skybox has been rendered. |
|
Copyright © by Martin Ecker |