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
glm::vec3 centerWorld-space box center, metres.
halfExtents
glm::vec3 halfExtentsBox half-size per local axis, metres (abs, >= 0.001).
orientation
glm::mat3 orientationBox rotation (columns = local axes); re-orthonormalized on add.
color
glm::vec4 colorLinear RGB tint (clamped to [0, 4]) and opacity in alpha ([0, 1]).
edgeFade
float edgeFadeFraction of the box (in normalized local units) faded at its faces, [0.001, 0.95].
normalFade
float normalFadeFacing fade: opacity ramps in as local-space normal Z goes 0..normalFade, [0.001, 1].
upperFade
float upperFadeExtra fade toward the box's local +Y face, as a fraction of the half-extent; 0 disables.
lowerFade
float lowerFadeExtra fade toward the box's local -Y face, as a fraction of the half-extent; 0 disables.
albedoMap
unsigned int albedoMapOptional GL 2D texture multiplied with color; 0 = none.
emissionMap
unsigned int emissionMapOptional GL 2D emission texture added to the decal color; 0 = none.
normalMap
unsigned int normalMapOptional GL 2D tangent-space normal map (approximate relief shading); 0 = none.
ormMap
unsigned int ormMapOptional GL 2D occlusion/roughness/metallic texture (R/G/B); 0 = none.
textureUvScaleOffset
glm::vec4 textureUvScaleOffsetUV transform (scale.xy, offset.zw) applied to all decal maps.
albedoMix
float albedoMixBlend from color toward albedoMap * color, [0, 1].
emissionEnergy
float emissionEnergyMultiplier for emissionMap, >= 0.
normalStrength
float normalStrengthnormalMap intensity, [0, 2].
ormStrength
float ormStrengthormMap influence, [0, 1].
distanceFadeEnabled
bool distanceFadeEnabledFade the decal out with camera distance to center.
distanceFadeBegin
float distanceFadeBeginDistance from the camera where the fade starts, metres.
distanceFadeLength
float distanceFadeLengthLength of the smooth fade band, metres.