skybox_drawable
Cube map drawn around the camera as a background.
Fields and methods
Members of the struct skybox_drawable. Most of what you do with a CGP type goes through the free functions listed below.
Fields
opengl_shader_structure shader | Shader program of the skybox, compiled from inline sources by initialize_data_on_gpu and deleted by clear. |
opengl_texture_image_structure texture | Cubemap texture of the skybox, set by the user, bound to texture unit 0 and sent to the uniform image_skybox. |
opengl_vbo_structure vbo_position | VBO storing the positions of the cube of side 2 centered at the origin, bound to shader location 0. |
opengl_ebo_structure ebo_connectivity | EBO storing the triangles of the skybox cube. |
GLuint vao = 0 | OpenGL id of the Vertex Array Object of the skybox, 0 when not initialized. |
affine model | Model transform sent to the uniform model, whose translation is ignored by the skybox vertex shader. |
mat3 skybox_rotation | Rotation applied to the lookup direction in the cubemap, sent to the uniform skybox_rotation and set to identity by initialize_data_on_gpu. |
float alpha_color_blending = 0.0f | Weight in [0,1] of color_blending mixed with the cubemap color, sent to the uniform alpha_color_blending, 0 by default. |
vec3 color_blending = vec3(1.0f, 1.0f, 1.0f) | RGB color mixed with the cubemap color according to alpha_color_blending, sent to the uniform color_blending, white by default. |
Methods
| Compiles the inline skybox shader, uploads a cube of side 2 into a VBO, an EBO and a VAO, and resets model and skybox_rotation to identity; aborts before compiling anything if the skybox is already initialized. src | |
| Deletes the VBO, the EBO, the VAO and the shader program, and resets texture, model and skybox_rotation without deleting the cubemap texture. src |
Functions taking a skybox_drawable
Draw 1
Functions returning a skybox_drawable
None.
Operators
None.