Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::render::Cubemap Class Reference
Inheritance diagram for oe::render::Cubemap:
Collaboration diagram for oe::render::Cubemap:

Public Member Functions

 Cubemap (const uint32_t &size, const int &internal_format=0, const int &format=0, const int &type=0, const int &max_mip=5)
 Cubemap (const std::string &equirectangular_filename, const float &brightness_multiplier=1.0f, const int &max_mips=5)
 Cubemap (const std::string &folder, const std::string &extension, const bool is_hdr=false, const std::vector< std::string > &faces={"posx", "negx", "posy", "negy", "posz", "negz"})
 Cubemap (const std::vector< std::string > &filenames, const bool is_hdr=false)
 Cubemap (const uint32_t size, const std::function< glm::vec4(const uint8_t face, const uint32_t i, const uint32_t j)> generator, const int &max_mips=5)
std::vector< std::byte > fetchTextureData (const uint32_t &face, const uint32_t &mip_level)
void fillTextureData (const std::vector< std::byte > &data, const uint32_t &face, const uint32_t &mip_level)
uint32_t getSize () const
virtual void enableBilinearFiltering (bool enabled=true) override
void generateMipMaps () override
void useMipMaps ()
Public Member Functions inherited from oe::render::Texture
 Texture (const uint32_t opengl_id)
 Create a texture using an existing OpenGL handle.
 Texture (const Texture &)=delete
Textureoperator= (const Texture &)=delete
 Texture (Texture &&other) noexcept
 Texture (const int32_t width, const int32_t height, const uint8_t *data, const int32_t nb_channels=0, const int32_t internal_format=0, const int32_t format=0, const int32_t type=0, const uint8_t max_mips=1)
 Load texture from raw gpu image data.
 Texture (const ByteSpan data, const ColorSpace color_space, const int32_t wanted_channels=4, const uint8_t max_mips=1)
 Load texture from an image stored in memory.
 Texture (const std::string &filename, const ColorSpace color_space, const uint8_t max_mips=1)
 Load texture from a file.
 Texture (const uint32_t width, const uint32_t height, const std::function< glm::vec4(const uint32_t i, const uint32_t j)> generator, const uint8_t max_mips=1)
 Generate a RGBA texture from a function returning a vec4.
 Texture (const uint32_t width, const uint32_t height, const oe::scene::Material &generator, const int32_t nb_channels=0, const int32_t internal_format=0, const int32_t format=0, const int32_t type=0, const uint8_t max_mips=1)
 Generate a texture from a material.
void use (const uint8_t layer)
void clampToEdge ()
void wrapRepeat ()
void fillTextureData (ByteSpan data, const uint32_t face, const uint32_t mip_level)
ByteArray fetchTextureData (const uint32_t face, const uint32_t mip_level)
 Get texture data from OpenGL memory.
glm::ivec2 getDimensions (const uint8_t mip_level=0) const
 Get dimensions of the texture.
uint32_t releaseOwnership ()
 Get ownership of the internal handle (to prevent external texture being destroyed) Only do this if you know what you are doing.

Protected Member Functions

bool _load_from_file (const std::vector< std::string > &filenames, const int &internal_format=0, const int &format=0, const int &type=0)
void _construct_cubemap (const std::vector< std::string > &filenames, const int &internal_format=0, const int &format=0, const int &type=0, const int &max_mips=5)
template<typename T>
void _generate_cubemap (const uint32_t &size, oe::render::Shader *shader, T *texture, const int &max_mips)
Protected Member Functions inherited from oe::render::Texture
void _generate_texture (const int32_t width, const int32_t height, const uint8_t *data, const int32_t nb_channels=0, const int32_t internal_format=0, const int32_t format=0, const int32_t type=0, const uint8_t max_mips=1)

Additional Inherited Members

Protected Attributes inherited from oe::render::Texture
uint32_t _internal_id = 0
int32_t _internal_format = 0
int32_t _format = 0
int32_t _type = 0

Constructor & Destructor Documentation

◆ Cubemap()

oe::render::Cubemap::Cubemap ( const uint32_t size,
const std::function< glm::vec4(const uint8_t face, const uint32_t i, const uint32_t j)> generator,
const int & max_mips = 5 )

Generate a RGBA cubemap from a function returning a vec4

Member Function Documentation

◆ enableBilinearFiltering()

virtual void oe::render::Cubemap::enableBilinearFiltering ( bool enabled = true)
overridevirtual

Reimplemented from oe::render::Texture.

◆ generateMipMaps()

void oe::render::Cubemap::generateMipMaps ( )
overridevirtual

Reimplemented from oe::render::Texture.


The documentation for this class was generated from the following file: