modules.cubemap#

class modules.cubemap.Cubemap(*args: Any, **kwargs: Any)#

Bases: Context

__init__(context)#

Cubemap loader class, which loads cubemaps and sets up IBL requirements like BRDF lut

Parameters:

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

bind(texture_id, texture_index, shader_uniform: str, shader_index: int)#

Bind texture using OpenGL with image index

Parameters:
  • texture_id (uint32/uintc) – the texture uid in GPU memory

  • texture_index (uint32/uintc) – The texture unit index in GLSL (eg. GL_TEXTURE0-GL_TEXTURE31)

  • shader_uniform (str) – The varaible name of the GLSL uniform sampler

  • shader_index (int) – Represent the number also indicated with ‘texture_index’. revisit this?

create_brdf_lut() None#

Load the BRDF lut used for IBL contributions Should be generated, but staticly loaded for now

static create_brdf_texture(size: int)#

Create the BRDF lut used for IBL contributions - Currently unused

Parameters:

size (int) – the dimension of the LUT, required to calculate each pixel

loadOrFind(path: str) int#

Load or find an image, implement find later :param path: The path to the the folder containing 6 textures, 1 for each side :type path: str