GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::ModelInstance3D Struct Reference

Configuration of a Model3D instance to draw. More...

#include <GREM/graphics_3d/Instances3D.hpp>

Public Attributes

Color color = Color::WHITE
 Tint color to use in the shader.
Color emissiveColor = Color::INVISIBLE
 Emissive color to use in the shader.
vec3 emissiveFactor {1.0f, 1.0f, 1.0f}
 Emissive factor to use in the shader.
uint32_t instanceIdentifier = 0
 Instance identifier that can be used to identify this instance in shaders.
float distanceOrderingBias = 0.0f
 Bias to subtract from the model's distance from the camera, which is used for distance ordering when drawing transparent meshes.

Detailed Description

Configuration of a Model3D instance to draw.

Member Data Documentation

◆ color

Color grem::graphics::ModelInstance3D::color = Color::WHITE

Tint color to use in the shader.

Note
In the default shaders, the base color is multiplied by this value, meaning that a value of Color::WHITE, i.e. RGBA(1, 1, 1, 1) in linear color, represents no modification to the original base color map color.

◆ emissiveColor

Color grem::graphics::ModelInstance3D::emissiveColor = Color::INVISIBLE

Emissive color to use in the shader.

Note
In the default shaders, the base color has this value added to it, meaning that a value of Color::INVISIBLE, i.e. RGBA(0, 0, 0, 0) in linear color, represents no modification to the original texture color.

◆ emissiveFactor

vec3 grem::graphics::ModelInstance3D::emissiveFactor {1.0f, 1.0f, 1.0f}

Emissive factor to use in the shader.

Note
In the default PBR shader, the emissive color is multiplied by this value, meaning that a value of (1, 1, 1) represents no modification to the original emissive map color.

◆ instanceIdentifier

uint32_t grem::graphics::ModelInstance3D::instanceIdentifier = 0

Instance identifier that can be used to identify this instance in shaders.

This may, for example, affect which decals are applied by the PBR shader.

◆ distanceOrderingBias

float grem::graphics::ModelInstance3D::distanceOrderingBias = 0.0f

Bias to subtract from the model's distance from the camera, which is used for distance ordering when drawing transparent meshes.

One possible strategy for reducing artifacts caused by incorrect ordering is to match this roughly to the average distance of the model's vertices from its origin.


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