Skip to content

raisin::ProjectedDecal ​

struct · #include <rayrai/SceneEffects.hpp>

Screen-space box decal blended over the opaque scene in the post-process pass.

The decal box is centered at center, rotated by orientation and sized by halfExtents (metres). Surfaces inside the box receive the decal. The decal projects along the box's local +Z axis: the decal UV comes from local X/Y, and surfaces facing away from local +Z are faded out by normalFade. Values are sanitized by RayraiWindow::addProjectedDecal() (ranges noted per field).

Public attributes ​

center ​

cpp
glm::vec3 center

World-space box center, metres.

halfExtents ​

cpp
glm::vec3 halfExtents

Box half-size per local axis, metres (abs, >= 0.001).

orientation ​

cpp
glm::mat3 orientation

Box rotation (columns = local axes); re-orthonormalized on add.

color ​

cpp
glm::vec4 color

Linear RGB tint (clamped to [0, 4]) and opacity in alpha ([0, 1]).

edgeFade ​

cpp
float edgeFade

Fraction of the box (in normalized local units) faded at its faces, [0.001, 0.95].

normalFade ​

cpp
float normalFade

Facing fade: opacity ramps in as local-space normal Z goes 0..normalFade, [0.001, 1].

upperFade ​

cpp
float upperFade

Extra fade toward the box's local +Y face, as a fraction of the half-extent; 0 disables.

lowerFade ​

cpp
float lowerFade

Extra fade toward the box's local -Y face, as a fraction of the half-extent; 0 disables.

albedoMap ​

cpp
unsigned int albedoMap

Optional GL 2D texture multiplied with color; 0 = none.

emissionMap ​

cpp
unsigned int emissionMap

Optional GL 2D emission texture added to the decal color; 0 = none.

normalMap ​

cpp
unsigned int normalMap

Optional GL 2D tangent-space normal map (approximate relief shading); 0 = none.

ormMap ​

cpp
unsigned int ormMap

Optional GL 2D occlusion/roughness/metallic texture (R/G/B); 0 = none.

textureUvScaleOffset ​

cpp
glm::vec4 textureUvScaleOffset

UV transform (scale.xy, offset.zw) applied to all decal maps.

albedoMix ​

cpp
float albedoMix

Blend from color toward albedoMap * color, [0, 1].

emissionEnergy ​

cpp
float emissionEnergy

Multiplier for emissionMap, >= 0.

normalStrength ​

cpp
float normalStrength

normalMap intensity, [0, 2].

ormStrength ​

cpp
float ormStrength

ormMap influence, [0, 1].

distanceFadeEnabled ​

cpp
bool distanceFadeEnabled

Fade the decal out with camera distance to center.

distanceFadeBegin ​

cpp
float distanceFadeBegin

Distance from the camera where the fade starts, metres.

distanceFadeLength ​

cpp
float distanceFadeLength

Length of the smooth fade band, metres.

RaiSim — physics for robotics and AI.