gameObjects.skybox#

class gameObjects.skybox.Skybox(*args: Any, **kwargs: Any)#

Bases: Context

class Type_(*values)#

Bases: IntEnum

procedural = 0#
skybox = 1#
__init__(context)#

Handles VAO, VBO creation for the skybox

Parameters:

context (EmberEngine) – This is the main context of the application

create_procedural_cubemap(scene: SceneManager.Scene = None) int#

Create the procedural cubemap Texture:GL_TEXTURE_CUBE_MAP and FBO, then extract

Parameters:

scene (Scene) – The scene data

Returns:

The index of the texture array in modules.Cubemap.cubemaps[]

Return type:

int

draw(scene: SceneManager.Scene) None#

Issue render commands to draw the skybox

extract_procedural_cubemap(scene: SceneManager.Scene = None) None#

Extract the prodedural sky to a cubemap.

Used in:

  • Environmental reflections (IBL)

  • Optimization when the procedural skybox is NOT in realtime mode.

Steps:

  1. For each of the 6 cubemap faces:
    • Position the camera at the origin

    • Orient the camera using the face side look direction and up vector

    • Set a 90deg Field-of-view projection

  2. Render the procedural skybox using the same pipeline as realtime mode (i.e., call self._draw_procedural, with extract_cubemap=True)

  3. Render into the procedural-sky framebuffer and texture.

Parameters:

scene (Scene) – The scene data