1#ifndef OE_RENDER_TEXTURE_H
2#define OE_RENDER_TEXTURE_H
8#include "../util/byte_array.h"
38 explicit Texture(
const uint32_t opengl_id);
44 _internal_id(other.releaseOwnership()),
45 _internal_format(other._internal_format),
46 _format(other._format),
57 const int32_t nb_channels = 0,
58 const int32_t internal_format = 0,
59 const int32_t format = 0,
60 const int32_t type = 0,
61 const uint8_t max_mips = 1
79 const int32_t wanted_channels = 4,
80 const uint8_t max_mips = 1
90 Texture(
const std::string& filename,
const ColorSpace color_space,
const uint8_t max_mips = 1);
97 const uint32_t height,
98 const std::function<glm::vec4(
const uint32_t i,
const uint32_t j)> generator,
99 const uint8_t max_mips = 1
106 const uint32_t width,
107 const uint32_t height,
109 const int32_t nb_channels = 0,
110 const int32_t internal_format = 0,
111 const int32_t format = 0,
112 const int32_t type = 0,
113 const uint8_t max_mips = 1
127 void use(
const uint8_t layer);
129 virtual void enableBilinearFiltering(
bool enabled =
true);
131 virtual void generateMipMaps();
136 void fillTextureData(ByteSpan data,
const uint32_t face,
const uint32_t mip_level);
166 void _generate_texture
169 const int32_t height,
171 const int32_t nb_channels = 0,
172 const int32_t internal_format = 0,
173 const int32_t format = 0,
174 const int32_t type = 0,
175 const uint8_t max_mips = 1
178 uint32_t _internal_id = 0;
181 int32_t _internal_format = 0;
Definition dynamic_cubemap.h:12
Definition framebuffer.h:53
uint32_t releaseOwnership()
Get ownership of the internal handle (to prevent external texture being destroyed) Only do this if yo...
Texture(const std::string &filename, const ColorSpace color_space, const uint8_t max_mips=1)
Load texture from a file.
ByteArray fetchTextureData(const uint32_t face, const uint32_t mip_level)
Get texture data from OpenGL memory.
Texture(const uint32_t opengl_id)
Create a texture using an existing OpenGL handle.
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.
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 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 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.
glm::ivec2 getDimensions(const uint8_t mip_level=0) const
Get dimensions of the texture.
Render agnostic material.
Definition material.h:90
Render related abstractions (Shader, Framebuffer, Cubemaps, Textures)
Definition opengl.h:10
ColorSpace
Definition texture.h:22
@ SRGB
Texture contains sRGB color (Albedo or Emissive)
@ Linear
Texture technical data that should be kept as-is (Normalmap, RouMetAo)
Scene related management (Render-agnostic Geometry, Manger, etc...)
Definition debug.h:19