Euphoria
Classes | Typedefs | Enumerations | Functions
Vertex layout

Functions and types related to transforming generic mesh data to renderable data used by shaders. More...

Classes

struct  eu::render::VertexElementDescription
 A not-yet-realised binding to a shader variable like vec3 position More...
 
struct  eu::render::CompiledVertexElement
 A realized VertexElementDescription like vec3 position at gl shader position 3. More...
 
struct  eu::render::CompiledVertexElementNoName
 A realized VertexElementDescription without name like vec3 at gl shader position 3. More...
 
struct  eu::render::CompiledShaderVertexAttributes
 A list of CompiledVertexElement (for shader) More...
 
struct  eu::render::CompiledGeomVertexAttributes
 A list of CompiledVertexLayoutNoNameList (for geom) More...
 
struct  eu::render::CompiledVertexTypeList
 A mapping of the vertex type (position...) to the actual shader id (for more than one shader) More...
 
struct  eu::render::InstanceProp
 A property for a shader used in instanced rendering. More...
 

Typedefs

using eu::render::ShaderVertexAttributes = std::vector< VertexElementDescription >
 Describes all vertex inputs a shader requires like [vec3 position, vec3 normal, vec2 uv]
 
using eu::render::VertexTypes = std::vector< VertexType >
 

Enumerations

enum class  eu::render::VertexType {
  eu::render::VertexType::position2xy , eu::render::VertexType::position2xz , eu::render::VertexType::position3 , eu::render::VertexType::normal3 ,
  eu::render::VertexType::color3 , eu::render::VertexType::color4 , eu::render::VertexType::texture2 , eu::render::VertexType::instance_transform
}
 Vertex source type, position, normal etc. More...
 

Functions

constexpr bool eu::render::is_instance_based (VertexType v)
 
std::vector< VertexTypeeu::render::find_duplicates (const ShaderVertexAttributes &items)
 
CompiledShaderVertexAttributes eu::render::compile_shader_layout (const CompiledVertexTypeList &l, const ShaderVertexAttributes &elements, std::optional< InstanceProp > instance_prop, std::optional< int > start_index)
 
CompiledGeomVertexAttributes eu::render::get_geom_layout (const CompiledVertexTypeList &l)
 
CompiledVertexTypeList eu::render::compile_attribute_layouts (const std::vector< VertexType > &base_layout, const std::vector< ShaderVertexAttributes > &descriptions)
 
CompiledVertexTypeList eu::render::compile_attribute_layouts (const std::vector< ShaderVertexAttributes > &descriptions)
 

Detailed Description

Functions and types related to transforming generic mesh data to renderable data used by shaders.

Typedef Documentation

◆ ShaderVertexAttributes

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

Describes all vertex inputs a shader requires like [vec3 position, vec3 normal, vec2 uv]

Note
It's invalid for this to contain duplicates, use find_duplicates to find duplicates

Definition at line 50 of file vertex_layout.h.

◆ VertexTypes

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

Definition at line 69 of file vertex_layout.h.

Enumeration Type Documentation

◆ VertexType

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

Vertex source type, position, normal etc.

Todo:
change to include other texture coordinates and custom types that are created from scripts
Enumerator
position2xy 
position2xz 
position3 
normal3 
color3 
color4 
texture2 
instance_transform 

Definition at line 17 of file vertex_layout.h.

Function Documentation

◆ compile_attribute_layouts() [1/2]

CompiledVertexTypeList eu::render::compile_attribute_layouts ( const std::vector< ShaderVertexAttributes > &  descriptions)

◆ compile_attribute_layouts() [2/2]

CompiledVertexTypeList eu::render::compile_attribute_layouts ( const std::vector< VertexType > &  base_layout,
const std::vector< ShaderVertexAttributes > &  descriptions 
)

◆ compile_shader_layout()

CompiledShaderVertexAttributes eu::render::compile_shader_layout ( const CompiledVertexTypeList l,
const ShaderVertexAttributes elements,
std::optional< InstanceProp instance_prop,
std::optional< int start_index 
)

◆ find_duplicates()

std::vector< VertexType > eu::render::find_duplicates ( const ShaderVertexAttributes items)

◆ get_geom_layout()

CompiledGeomVertexAttributes eu::render::get_geom_layout ( const CompiledVertexTypeList l)

◆ is_instance_based()

constexpr bool eu::render::is_instance_based ( VertexType  v)
constexpr

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

Definition at line 32 of file vertex_layout.h.