Euphoria
Classes | Enumerations | Functions | Variables
Texture

Classes

struct  eu::render::BaseTexture
 Base class for all textures, but only exist due to code reuse and can easily be inlined. More...
 
struct  eu::render::Texture2d
 A 2d image texture. More...
 
struct  eu::render::TextureCubemap
 A cubemap texture. More...
 
struct  eu::render::FrameBuffer
 "render to texture" feature More...
 
struct  eu::render::BoundFbo
 raii class to render to a FrameBuffer More...
 

Enumerations

enum class  eu::render::TextureEdge { eu::render::TextureEdge::clamp , eu::render::TextureEdge::repeat }
 
enum class  eu::render::TextureRenderStyle { eu::render::TextureRenderStyle::pixel , eu::render::TextureRenderStyle::mipmap , eu::render::TextureRenderStyle::linear }
 
enum class  eu::render::Transparency { eu::render::Transparency::include , eu::render::Transparency::exclude }
 
enum class  eu::render::ColorData { eu::render::ColorData::color_data , eu::render::ColorData::non_color_data , eu::render::ColorData::dont_care }
 
enum class  eu::render::SingleColor : std::uint32_t
 A single color in a format to load directly into open gl texture(ABGR on little endian). More...
 
enum class  eu::render::DepthBits { eu::render::DepthBits::use_none , eu::render::DepthBits::use_16 , eu::render::DepthBits::use_24 , eu::render::DepthBits::use_32 }
 The number of bits to use for the depth buffer. More...
 
enum class  eu::render::ColorBitsPerPixel { eu::render::ColorBitsPerPixel::use_depth , eu::render::ColorBitsPerPixel::use_8 , eu::render::ColorBitsPerPixel::use_16 , eu::render::ColorBitsPerPixel::use_32 }
 The number of bits/pixel to use for the color buffer. More...
 

Functions

constexpr SingleColor eu::render::color_from_rgba (uint8_t r, uint8_t g, uint8_t b, uint8_t a)
 Constructs a SingleColor value from individual red, green, blue, and alpha components.
 
Texture2d eu::render::load_image_from_color (DEBUG_LABEL_ARG_MANY SingleColor pixel, TextureEdge te, TextureRenderStyle trs, Transparency t, ColorData cd)
 
TextureCubemap eu::render::load_cubemap_from_color (DEBUG_LABEL_ARG_MANY SingleColor pixel, ColorData cd)
 
std::shared_ptr< FrameBuffereu::render::build_simple_framebuffer (DEBUG_LABEL_ARG_MANY const Size &size)
 Build a simple LDR frame buffer.
 
std::shared_ptr< FrameBuffereu::render::build_msaa_framebuffer (DEBUG_LABEL_ARG_MANY const Size &size, int msaa_samples, ColorBitsPerPixel bits_per_pixel)
 Builds a multisample anti-aliasing (MSAA) framebuffer for high-quality rendering.
 
std::shared_ptr< FrameBuffereu::render::build_hdr_floating_framebuffer (DEBUG_LABEL_ARG_MANY const Size &size, ColorBitsPerPixel bits_per_pixel)
 Build a HDR frame buffer.
 
std::shared_ptr< FrameBuffereu::render::build_shadow_framebuffer (DEBUG_LABEL_ARG_MANY const Size &size)
 Create a depth-only framebuffer for shadow rendering.
 
void eu::render::resolve_multisampled_buffer (const FrameBuffer &src, FrameBuffer *dst)
 

Variables

constexpr std::size_t eu::render::cubemap_size = 6
 0=right(x+), 1=left(x-), 2=top(y+), 3=bottom(y-), 4=front(z+), 5=back(z-)
 

Detailed Description

Enumeration Type Documentation

◆ ColorBitsPerPixel

#include <libs/render/src/render/texture.h>

The number of bits/pixel to use for the color buffer.

Enumerator
use_depth 
use_8 
use_16 
use_32 

Definition at line 145 of file texture.h.

◆ ColorData

#include <libs/render/src/render/texture.h>

Enumerator
color_data 

Apply transformations to the color data. Texture is a diffuse/albedo map, created with human eyes on a monitor in sRGB space.

non_color_data 

Don't apply transformations to the color data. Texture is a normal/roughness/ao/specular map or similar and created by a software in linear space.

dont_care 

Explicitly don't care about the color data but same as non_color_data.

Definition at line 37 of file texture.h.

◆ DepthBits

#include <libs/render/src/render/texture.h>

The number of bits to use for the depth buffer.

Enumerator
use_none 
use_16 
use_24 
use_32 

Definition at line 138 of file texture.h.

◆ SingleColor

enum class eu::render::SingleColor : std::uint32_t
strong

#include <libs/render/src/render/texture.h>

A single color in a format to load directly into open gl texture(ABGR on little endian).

See also
color_from_rgba

Definition at line 53 of file texture.h.

◆ TextureEdge

#include <libs/render/src/render/texture.h>

Enumerator
clamp 
repeat 

Definition at line 16 of file texture.h.

◆ TextureRenderStyle

#include <libs/render/src/render/texture.h>

Enumerator
pixel 
mipmap 
linear 

Definition at line 23 of file texture.h.

◆ Transparency

#include <libs/render/src/render/texture.h>

Enumerator
include 
exclude 

Definition at line 31 of file texture.h.

Function Documentation

◆ build_hdr_floating_framebuffer()

std::shared_ptr< FrameBuffer > eu::render::build_hdr_floating_framebuffer ( DEBUG_LABEL_ARG_MANY const Size size,
ColorBitsPerPixel  bits_per_pixel 
)

#include <libs/render/src/render/texture.h>

Build a HDR frame buffer.

Parameters
sizeThe resolution in pixels.
bits_per_pixelHow many bits per pixel to use
Returns
The created FrameBuffer

◆ build_msaa_framebuffer()

std::shared_ptr< FrameBuffer > eu::render::build_msaa_framebuffer ( DEBUG_LABEL_ARG_MANY const Size size,
int  msaa_samples,
ColorBitsPerPixel  bits_per_pixel 
)

#include <libs/render/src/render/texture.h>

Builds a multisample anti-aliasing (MSAA) framebuffer for high-quality rendering.

This function creates a framebuffer object (FBO) with multisample support, allowing for smoother edges and reduced aliasing artifacts in rendered images.

Parameters
sizeThe dimensions (width, height) of the framebuffer in pixels.
msaa_samplesThe number of MSAA samples to use. Higher values provide better anti-aliasing but may impact performance. Typical values are 2, 4, or 8.
bits_per_pixelThe color buffer precision.
Returns
The created FrameBuffer object with MSAA enabled.

◆ build_shadow_framebuffer()

std::shared_ptr< FrameBuffer > eu::render::build_shadow_framebuffer ( DEBUG_LABEL_ARG_MANY const Size size)

#include <libs/render/src/render/texture.h>

Create a depth-only framebuffer for shadow rendering.

Parameters
sizeThe resolution in pixels.
Returns
The created FrameBuffer

◆ build_simple_framebuffer()

std::shared_ptr< FrameBuffer > eu::render::build_simple_framebuffer ( DEBUG_LABEL_ARG_MANY const Size size)

#include <libs/render/src/render/texture.h>

Build a simple LDR frame buffer.

This is mostly used for post-processing.

Parameters
sizeThe size of the framebuffer.
Returns
The created FrameBuffer.

◆ color_from_rgba()

constexpr SingleColor eu::render::color_from_rgba ( uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a 
)
constexpr

#include <libs/render/src/render/texture.h>

Constructs a SingleColor value from individual red, green, blue, and alpha components.

Parameters
rThe red component of the color (0x00 - 0xFF).
gThe green component of the color (0x00 - 0xFF).
bThe blue component of the color (0x00 - 0xFF).
aThe alpha (opacity) component of the color (0x00 - 0xFF).
Returns
A SingleColor value representing the color composed of the specified RGBA components.

Definition at line 61 of file texture.h.

◆ load_cubemap_from_color()

TextureCubemap eu::render::load_cubemap_from_color ( DEBUG_LABEL_ARG_MANY SingleColor  pixel,
ColorData  cd 
)

◆ load_image_from_color()

Texture2d eu::render::load_image_from_color ( DEBUG_LABEL_ARG_MANY SingleColor  pixel,
TextureEdge  te,
TextureRenderStyle  trs,
Transparency  t,
ColorData  cd 
)

◆ resolve_multisampled_buffer()

void eu::render::resolve_multisampled_buffer ( const FrameBuffer src,
FrameBuffer dst 
)

Variable Documentation

◆ cubemap_size

constexpr std::size_t eu::render::cubemap_size = 6
constexpr

#include <libs/render/src/render/texture.h>

0=right(x+), 1=left(x-), 2=top(y+), 3=bottom(y-), 4=front(z+), 5=back(z-)

Definition at line 100 of file texture.h.