Euphoria
Classes | Typedefs | Enumerations | Functions
Renderer

Classes

struct  eu::core::UniformBufferSetup
 
struct  eu::core::CompiledUniformProp
 A compiled uniform buffer property that can be used in a shader. More...
 
struct  eu::core::UniformProp
 internal More...
 
struct  eu::core::UniformBufferCompiler
 
struct  eu::render::Camera
 The current perspective camera representation. More...
 
struct  eu::render::OrthoCamera
 A orthographic camera representation. More...
 
struct  eu::render::CompiledCamera
 A "compiled" camera for use in rendering. More...
 
struct  eu::render::DebugLine
 Line + color. More...
 
struct  eu::render::DebugRender
 Just stores debug render requests and doesn't actually render anything. More...
 
struct  eu::render::FullScreenGeom
 Store the information for how to render a full screen quad. More...
 
struct  eu::render::Material
 Base class for all materials. More...
 
struct  eu::render::UnlitMaterial
 A unlit (or fully lit) material, not affected by light. More...
 
struct  eu::render::DefaultMaterial
 A material affected by light. More...
 
struct  eu::render::RenderSettings
 Startup settings for the renderer. More...
 
struct  eu::render::ShadowContext
 
struct  eu::render::Renderer
 The rendering engine. More...
 
struct  eu::render::RendererPimpl
 Internal state of the renderer. More...
 
struct  eu::render::CameraUniformBuffer
 "Global state" for the shaders describing the state of the camera. More...
 
struct  eu::render::LoadedShader_SingleColor
 A single color shader. More...
 
struct  eu::render::LoadedShader_OnlyDepth
 Only writes depth. More...
 
struct  eu::render::LoadedShader_Skybox
 A skybox shader. More...
 
struct  eu::render::LoadedShader_Unlit
 Parts of a loaded unlit shader. More...
 
struct  eu::render::DirectionalLightUniforms
 Uniform for a directional light. More...
 
struct  eu::render::PointLightUniforms
 Uniforms for a point light. More...
 
struct  eu::render::FrustumLightUniforms
 Uniforms for a frustum light. More...
 
struct  eu::render::LoadedPostProcShader
 The "base class" for a loaded postproc shader. More...
 
struct  eu::render::LoadedShader_Default
 Part of a loaded "default" shader. More...
 
struct  eu::render::RenderContext
 Stores information that is useful when selecting a shader part from a shader container. More...
 
struct  eu::render::LoadedShader_Unlit_Container
 A unlit shader. More...
 
struct  eu::render::LoadedShader_Default_Container
 A default shader. More...
 
struct  eu::render::RealizeShader
 The shader data for composing a rendered image. More...
 
struct  eu::render::ExtractShader
 Extracts data for a bloom. More...
 
struct  eu::render::PingPongBlurShader
 
struct  eu::render::ShaderResource
 All loaded shaders. More...
 
struct  eu::render::State
 A "cache" for the current open gl state. More...
 
struct  eu::render::StateChanger
 A helper class to change both the opengl state and the cache. More...
 
struct  eu::render::UniformBuffer
 
struct  eu::render::BoundUniformBuffer
 
struct  eu::render::CompiledGeom
 Represents a Geom on the GPU. More...
 
struct  eu::render::CompiledGeom_TransformInstance
 Represents a Geom on the GPU, instanced on a transform. More...
 
struct  eu::render::LocalAxis
 
struct  eu::render::MeshInstance
 Stores Geom + Material (aka a mesh) and its current transform. More...
 
struct  eu::render::MeshInstance_TransformInstanced
 Stores Geom + Material (aka a mesh) and its current transform but instanced for faster rendering. More...
 
struct  eu::render::DirectionalLight
 A directional light,. More...
 
struct  eu::render::PointLight
 A point light. More...
 
struct  eu::render::FrustumLight
 Like a spotlight but can be positioned with a transform, supports light cookies and can use a "view frustum" when culling. More...
 
struct  eu::render::Lights
 All lights in a world. More...
 
struct  eu::render::Skybox
 A skybox model with a cubemap texture. More...
 
struct  eu::render::World
 A list of objects to render. More...
 

Typedefs

using eu::render::BlendMode = std::tuple< Blend, Blend >
 Blend mode state consisting of src and dst blend functions.
 
using eu::render::StencilFunc = std::tuple< Compare, i32, u32 >
 Stencil function state consisiting of the compare function, the ref and the state.
 
using eu::render::StencilOp = std::tuple< StencilAction, StencilAction, StencilAction >
 Stencil operation state consisting of the stencil fail, depth fail and the pass action.
 

Enumerations

enum class  eu::core::UniformType {
  eu::core::UniformType::invalid , eu::core::UniformType::bool_type , eu::core::UniformType::int_type , eu::core::UniformType::float_type ,
  eu::core::UniformType::vec2 , eu::core::UniformType::vec3 , eu::core::UniformType::vec4 , eu::core::UniformType::mat4
}
 
enum class  eu::render::TransformSource { eu::render::TransformSource::Uniform , eu::render::TransformSource::Instanced_mat4 }
 Enum describing on how the model transform is provided. More...
 
enum class  eu::render::PostProcSetup { eu::render::PostProcSetup::none = 0 , eu::render::PostProcSetup::factor = 1 << 1 , eu::render::PostProcSetup::resolution = 1 << 2 , eu::render::PostProcSetup::time = 1 << 3 }
 Bitmask for what features each postproc shader wants. More...
 
enum class  eu::render::UseTransparency { eu::render::UseTransparency::yes , eu::render::UseTransparency::no }
 A "named boolean". More...
 
enum class  eu::render::Blend {
  eu::render::Blend::zero , eu::render::Blend::one , eu::render::Blend::src_color , eu::render::Blend::one_minus_src_color ,
  eu::render::Blend::dst_color , eu::render::Blend::one_minus_dst_color , eu::render::Blend::src_alpha , eu::render::Blend::one_minus_src_alpha ,
  eu::render::Blend::dst_alpha , eu::render::Blend::one_minus_dst_alpha , eu::render::Blend::constant_color , eu::render::Blend::one_minus_constant_color ,
  eu::render::Blend::constant_alpha , eu::render::Blend::one_minus_constant_alpha , eu::render::Blend::src_alpha_saturate , eu::render::Blend::src1_color ,
  eu::render::Blend::one_minus_src1_color , eu::render::Blend::src1_alpha , eu::render::Blend::one_minus_src1_alpha
}
 
enum class  eu::render::Compare {
  eu::render::Compare::always , eu::render::Compare::never , eu::render::Compare::less , eu::render::Compare::equal ,
  eu::render::Compare::less_equal , eu::render::Compare::greater , eu::render::Compare::not_equal , eu::render::Compare::greater_equal
}
 
enum class  eu::render::CullFace { eu::render::CullFace::front , eu::render::CullFace::back , eu::render::CullFace::front_and_back }
 
enum class  eu::render::RenderMode { eu::render::RenderMode::fill , eu::render::RenderMode::line , eu::render::RenderMode::point }
 
enum class  eu::render::StencilAction {
  eu::render::StencilAction::keep , eu::render::StencilAction::zero , eu::render::StencilAction::replace , eu::render::StencilAction::increase ,
  eu::render::StencilAction::increase_wrap , eu::render::StencilAction::decrease , eu::render::StencilAction::decrease_wrap , eu::render::StencilAction::invert
}
 
enum class  eu::render::Billboarding {
  eu::render::Billboarding::none , eu::render::Billboarding::screen , eu::render::Billboarding::screen_fast , eu::render::Billboarding::axial_y ,
  eu::render::Billboarding::axial_y_fast
}
 Defines the billboarding algorithm to use. More...
 

Functions

CameraVectors eu::render::create_vectors (const Camera &camera)
 Capture the current local space of the camera.
 
m4 eu::render::create_view_from_world_mat (const v3 &pos, const CameraVectors &cv)
 
CompiledCamera eu::render::compile (const Camera &, const Size &window_size)
 "Compile" a camera to a perspective so it can be used in rendering.
 
CompiledCamera eu::render::compile (const OrthoCamera &, const Size &window_size)
 "Compile" a camera to an orthographic view so it can be used in rendering.
 
v2 eu::render::screen_from_world (const CompiledCamera &cam, const v3 &world_pos, const v2 &resolution)
 Calculate the screen coordinate of a 3d world position.
 
void eu::render::draw_frustum (DebugRender *debug, const CompiledCamera &camera, const Rgb &color)
 
v3 eu::render::vec_from_lin (const Lin_rgb &lin)
 
PostProcSetup eu::render::operator| (PostProcSetup lhs, PostProcSetup rhs)
 
const LoadedShader_Unliteu::render::shader_from_container (const LoadedShader_Unlit_Container &container, const RenderContext &rc)
 Select the correct sub shader from a container.
 
const LoadedShader_Defaulteu::render::shader_from_container (const LoadedShader_Default_Container &container, const RenderContext &rc)
 Select the correct sub shader from a container.
 
ShaderResource eu::render::load_shaders (const Assets &assets, const CameraUniformBuffer &desc, const RenderSettings &settings, const FullScreenGeom &full_screen)
 
void eu::render::bind_texture_2d (State *states, const Uniform &uniform, const Texture2d &texture)
 
void eu::render::bind_texture_2d (State *states, const Uniform &uniform, const FrameBuffer &texture)
 
void eu::render::bind_texture_cubemap (State *states, const Uniform &uniform, const TextureCubemap &texture)
 
std::shared_ptr< CompiledGeomeu::render::compile_geom (DEBUG_LABEL_ARG_MANY const core::Geom &, const core::CompiledGeomVertexAttributes &layout)
 
std::shared_ptr< CompiledGeom_TransformInstanceeu::render::compile_geom_with_transform_instance (DEBUG_LABEL_ARG_MANY const core::Geom &, const core::CompiledGeomVertexAttributes &layout, std::size_t max_instances)
 
m4 eu::render::transform_from_rotation (const v3 &position, const Ypr &ypr)
 
m4 eu::render::transform_from_billboard (const v3 &position, Billboarding billboarding, const CompiledCamera &cc)
 
std::shared_ptr< MeshInstanceeu::render::make_mesh_instance (std::shared_ptr< CompiledGeom > geom, std::shared_ptr< Material > mat)
 
std::shared_ptr< MeshInstance_TransformInstancedeu::render::make_mesh_instance (std::shared_ptr< CompiledGeom_TransformInstance > geom, std::shared_ptr< Material > mat)
 
void eu::render::render_geom (const CompiledGeom &geom)
 
void eu::render::render_geom_instanced (const MeshInstance_TransformInstanced &instanced)
 
CameraVectors eu::render::create_vectors (const DirectionalLight &p)
 

Detailed Description

Typedef Documentation

◆ BlendMode

#include <libs/render/src/eu/render/state.h>

Blend mode state consisting of src and dst blend functions.

Definition at line 103 of file state.h.

◆ StencilFunc

#include <libs/render/src/eu/render/state.h>

Stencil function state consisiting of the compare function, the ref and the state.

See also
StateChanger::stencil_func

Definition at line 107 of file state.h.

◆ StencilOp

#include <libs/render/src/eu/render/state.h>

Stencil operation state consisting of the stencil fail, depth fail and the pass action.

Definition at line 110 of file state.h.

Enumeration Type Documentation

◆ Billboarding

#include <libs/render/src/eu/render/world.h>

Defines the billboarding algorithm to use.

Enumerator
none 
screen 
screen_fast 
axial_y 
axial_y_fast 

Definition at line 77 of file world.h.

◆ Blend

#include <libs/render/src/eu/render/state.h>

Enumerator
zero 
one 
src_color 
one_minus_src_color 
dst_color 
one_minus_dst_color 
src_alpha 
one_minus_src_alpha 
dst_alpha 
one_minus_dst_alpha 
constant_color 
one_minus_constant_color 
constant_alpha 
one_minus_constant_alpha 
src_alpha_saturate 
src1_color 
one_minus_src1_color 
src1_alpha 
one_minus_src1_alpha 

Definition at line 28 of file state.h.

◆ Compare

#include <libs/render/src/eu/render/state.h>

Enumerator
always 
never 
less 
equal 
less_equal 
greater 
not_equal 
greater_equal 

Definition at line 51 of file state.h.

◆ CullFace

#include <libs/render/src/eu/render/state.h>

Enumerator
front 
back 
front_and_back 

Definition at line 63 of file state.h.

◆ PostProcSetup

#include <libs/render/src/eu/render/shader_resource.h>

Bitmask for what features each postproc shader wants.

Enumerator
none 
factor 
resolution 
time 

Definition at line 141 of file shader_resource.h.

◆ RenderMode

#include <libs/render/src/eu/render/state.h>

Enumerator
fill 
line 
point 

Definition at line 70 of file state.h.

◆ StencilAction

#include <libs/render/src/eu/render/state.h>

Enumerator
keep 

The currently stored stencil value is kept.

zero 

The stencil value is set to 0.

replace 

The stencil value is replaced with the reference value set with stencil_func.

increase 

The stencil value is increased by 1 if it is lower than the maximum value.

increase_wrap 

Same as increase, but wraps it back to 0 as soon as the maximum value is exceeded.

decrease 

The stencil value is decreased by 1 if it is higher than the minimum value.

decrease_wrap 

Same as decrease, but wraps it to the maximum value if it ends up lower than 0.

invert 

Bitwise inverts the current stencil buffer value.

Definition at line 77 of file state.h.

◆ TransformSource

#include <libs/render/src/eu/render/shader_resource.h>

Enum describing on how the model transform is provided.

Enumerator
Uniform 

the model source is provided as a mat4 uniform.

Instanced_mat4 

the model source is provided as a (instanced) mat4 attribute

Definition at line 26 of file shader_resource.h.

◆ UniformType

#include <libs/core/src/eu/core/uniform_buffer.h>

Enumerator
invalid 
bool_type 
int_type 
float_type 
vec2 
vec3 
vec4 
mat4 

Definition at line 11 of file uniform_buffer.h.

◆ UseTransparency

#include <libs/render/src/eu/render/shader_resource.h>

A "named boolean".

Enumerator
yes 
no 

Definition at line 194 of file shader_resource.h.

Function Documentation

◆ bind_texture_2d() [1/2]

void eu::render::bind_texture_2d ( State states,
const Uniform uniform,
const FrameBuffer texture 
)

◆ bind_texture_2d() [2/2]

void eu::render::bind_texture_2d ( State states,
const Uniform uniform,
const Texture2d texture 
)

◆ bind_texture_cubemap()

void eu::render::bind_texture_cubemap ( State states,
const Uniform uniform,
const TextureCubemap texture 
)

◆ compile() [1/2]

CompiledCamera eu::render::compile ( const Camera ,
const Size window_size 
)

#include <libs/render/src/eu/render/camera.h>

"Compile" a camera to a perspective so it can be used in rendering.

◆ compile() [2/2]

CompiledCamera eu::render::compile ( const OrthoCamera ,
const Size window_size 
)

#include <libs/render/src/eu/render/camera.h>

"Compile" a camera to an orthographic view so it can be used in rendering.

◆ compile_geom()

std::shared_ptr< CompiledGeom > eu::render::compile_geom ( DEBUG_LABEL_ARG_MANY const core::Geom ,
const core::CompiledGeomVertexAttributes layout 
)

◆ compile_geom_with_transform_instance()

std::shared_ptr< CompiledGeom_TransformInstance > eu::render::compile_geom_with_transform_instance ( DEBUG_LABEL_ARG_MANY const core::Geom ,
const core::CompiledGeomVertexAttributes layout,
std::size_t  max_instances 
)

◆ create_vectors() [1/2]

CameraVectors eu::render::create_vectors ( const Camera camera)

#include <libs/render/src/eu/render/camera.h>

Capture the current local space of the camera.

◆ create_vectors() [2/2]

CameraVectors eu::render::create_vectors ( const DirectionalLight p)

◆ create_view_from_world_mat()

m4 eu::render::create_view_from_world_mat ( const v3 pos,
const CameraVectors cv 
)

◆ draw_frustum()

void eu::render::draw_frustum ( DebugRender debug,
const CompiledCamera camera,
const Rgb color 
)

◆ load_shaders()

ShaderResource eu::render::load_shaders ( const Assets assets,
const CameraUniformBuffer desc,
const RenderSettings settings,
const FullScreenGeom full_screen 
)

◆ make_mesh_instance() [1/2]

std::shared_ptr< MeshInstance > eu::render::make_mesh_instance ( std::shared_ptr< CompiledGeom geom,
std::shared_ptr< Material mat 
)

◆ make_mesh_instance() [2/2]

std::shared_ptr< MeshInstance_TransformInstanced > eu::render::make_mesh_instance ( std::shared_ptr< CompiledGeom_TransformInstance geom,
std::shared_ptr< Material mat 
)

◆ operator|()

PostProcSetup eu::render::operator| ( PostProcSetup  lhs,
PostProcSetup  rhs 
)

◆ render_geom()

void eu::render::render_geom ( const CompiledGeom geom)

◆ render_geom_instanced()

void eu::render::render_geom_instanced ( const MeshInstance_TransformInstanced instanced)

◆ screen_from_world()

v2 eu::render::screen_from_world ( const CompiledCamera cam,
const v3 world_pos,
const v2 resolution 
)

#include <libs/render/src/eu/render/camera.h>

Calculate the screen coordinate of a 3d world position.

◆ shader_from_container() [1/2]

const LoadedShader_Default & eu::render::shader_from_container ( const LoadedShader_Default_Container container,
const RenderContext rc 
)

#include <libs/render/src/eu/render/shader_resource.h>

Select the correct sub shader from a container.

◆ shader_from_container() [2/2]

const LoadedShader_Unlit & eu::render::shader_from_container ( const LoadedShader_Unlit_Container container,
const RenderContext rc 
)

#include <libs/render/src/eu/render/shader_resource.h>

Select the correct sub shader from a container.

◆ transform_from_billboard()

m4 eu::render::transform_from_billboard ( const v3 position,
Billboarding  billboarding,
const CompiledCamera cc 
)

◆ transform_from_rotation()

m4 eu::render::transform_from_rotation ( const v3 position,
const Ypr ypr 
)

◆ vec_from_lin()

v3 eu::render::vec_from_lin ( const Lin_rgb lin)