raisin
namespace
The rayrai renderer (the namespace is spelled raisin): render windows, cameras, materials, lights, visuals and the TCP viewer.
Namespaces
- raisin::assimp
- raisin::color
- raisin::lidar_grid
- raisin::rayrai
- raisin::tcp_viewer
- raisin::texture — Free-function texture creators decoupled from RayraiWindow.
Classes
Renderer A–L
structAdditionalLight — Lightweight imported or viewer light used for extra fill/rim lighting.structBakedIrradianceGrid — Regular 3D grid of irradiance probes spanning an axis-aligned box.structBc7TextureStorageResult — Outcome of compressRgbTextureBc7(); all zero when the texture was left unchanged.classCamera — Camera for offscreen rendering and interaction.classCameraFrustum — Visual helper that renders camera frustum edges.classCloudTextures — CloudTextures owns the GPU textures used by the cloud rendering pipeline: baseTex: 3D RGBA8 Worley/Perlin noise (128^3) for the volumetric path detailTex: 3D RGBA8 Worley noise (32^3) for the…classCoordinateFrame — Render helper for visualizing multiple coordinate frames.structDebugPassCapture — One debug view returned by RayraiWindow::captureDebugPasses() (final image, base color, normals, shadow terms, AO, fog, ...).structDirectionalShadowCascade — One cascade of a DirectionalShadowCascadePlan. Distances are view distances in metres.structDirectionalShadowCascadePlan — Directional-light cascade layout for a camera (RayraiWindow::planDirectionalShadowCascades()), derived from the RenderQualitySettings::directionalShadowCascade* fields.structDynamicQualityRecommendation — Quality reduction suggested from measured pass timings (RayraiWindow::recommendDynamicQuality()). Never applied automatically.structEnvironmentSidecarSettings — Optional environment/lighting overrides from a scene's environment sidecar JSON (<scene>.rayrai_environment.json, see RayraiWindow::loadEnvironmentSidecar()).structExposureRecommendation — Bounded exposure suggestion derived from RgbaLuminanceMetrics (RayraiWindow::recommendExposure()). Never applied automatically.structFoliageGeometryAtlasOptions — Options for buildFoliageGeometryAtlasForMeshes().structFoliageGeometryAtlasResult — Outcome of buildFoliageGeometryAtlasForMeshes().classFoliageMeshLodBaker — A textured 3D foliage LOD reconstructed from six or ten source-mesh captures.structFoliageTextureAtlasOptions — Options for buildFoliageTextureAtlasForMeshes().structFoliageTextureAtlasResult — Outcome of buildFoliageTextureAtlasForMeshes().structGeometryRefractionDiagnostics — State of the geometry-refraction tracer after the most recent frame (RayraiWindow::geometryRefractionDiagnostics()).structGeometryRefractionSamplingStatistics — Per-pixel sample statistics of the geometry-refraction history (RayraiWindow::geometryRefractionSamplingStatistics()).classInstancedVisuals — Many copies of one shape or mesh drawn with GPU instancing.structIrradianceVolume — Oriented box that adds a constant diffuse irradiance to PBR surfaces inside it.classLensDropletCompositeSystem — Owns the FBO + composite texture used by the lens-droplet pass. RGBA16F target, sized to the scene viewport.classLight — Simple light with optional shadow map support.structLightInfluenceRange — Distance window over which a local light's contribution is faded out and then culled (world units, measured from the light position).structLocalFogVolume — Spherical local fog region evaluated in the post-process pass.
Renderer M–P
classMaterial — A general-purpose material class supporting PBR, textured, and simple color models.structMaterialTextureBudgetRecommendation — Texture-memory fallback suggestion (RayraiWindow::recommendMaterialTextureBudget()). Never applied automatically and never unloads textures.structMeshPreprocessCacheStats — Process-wide counters of cache activity (see meshPreprocessCacheStatsSnapshot()).structMeshPreprocessMetadata — Summary of a loaded mesh list used to skip re-scanning geometry.structPbrEnvironment — Image-based lighting environment bundle.structPhysicsLinkPosestructPhysicsMeshSnapshot — Complete dynamic mesh.structPhysicsObjectSnapshotstructPhysicsRenderDescriptionstructPhysicsShapeSnapshot — Persistent geometry and local visual transform, shared across pose-only frames.structPhysicsSnapshot — Immutable, complete frame. Hold its shared owner while publishing or consuming it.classPhysicsSnapshotCapture — Physics-thread capture, without GL or locks: the caller protects the World.structPhysicsTendonSnapshotclassPointCloud — Simple point cloud renderer.structProjectedDecal — Screen-space box decal blended over the opaque scene in the post-process pass.
Renderer R
classRaisimObject — Render state of one raisim::Object, built from physics snapshots.classRayraiGlobalAsset — A caching asset manager for 3D models and primitive meshes.classRayraiWindow — Offscreen renderer and visual scene manager for raisim.structReflectionProbe — Static local reflection probe registered with RayraiWindow::addReflectionProbe().structReflectionProbeBlend — Result of RayraiWindow::selectReflectionProbeBlend() for one sample position.structReflectionProbeCaptureFrame — Camera basis used to capture one cubemap face (RayraiWindow::reflectionProbeCaptureFrame()).structReflectionProbeCaptureSettings — Explicit static reflection-probe capture settings.structReflectionProbeDebugItem — Per-probe entry of a ReflectionProbeDebugView.structReflectionProbeDebugOverlaySummary — CPU summary shown by the optional reflection-probe debug overlay (RayraiWindow::reflectionProbeDebugOverlaySummary()).structReflectionProbeDebugView — Probe selection details at one position (RayraiWindow::reflectionProbeDebugView()).structReflectionProbeFilterSettings — Explicit CPU filtering settings for captured local reflection probes.structReflectionProbePlacementSuggestion — Probe placement suggested from scene bounds (RayraiWindow::suggestReflectionProbePlacementFromSceneBounds()).structReflectionProbeSidecarProbe — One probe entry read from a scene's reflection-probe sidecar JSON (<scene>.rayrai_probes.json, see RayraiWindow::loadReflectionProbeSidecar()).structReflectionProbeSidecarSettings — Optional quality overrides from the reflection-probe sidecar's "quality" block.structRenderOverrides — Override shaders and rendering toggles when using external cameras.structRenderPassAccounting — Estimated per-frame render passes for the current settings (RayraiWindow::estimateRenderPassAccounting()). CPU estimate only; no GPU timing.structRenderPassTiming — GPU time of one named render pass (from captureRenderPassTimings()).structRenderQualitySettings — Explicit runtime quality settings for viewer rendering.structRgbaCalibrationMetrics — Aggregate patch errors from RayraiWindow::analyzeRgbaCalibrationPatches(); averages are over valid patches only.structRgbaCalibrationPatch — Rectangular reference patch for RayraiWindow::analyzeRgbaCalibrationPatches().structRgbaCalibrationPatchResult — Measurement of one RgbaCalibrationPatch; all colors are display-space RGB in [0, 1].structRgbaCalibrationRecommendation — Output transform suggested from calibration patches (RayraiWindow::recommendCalibrationOutputTransform()). Never applied automatically.structRgbaLuminanceHistogram — Display-space luminance histogram of an RGBA8 image (RayraiWindow::analyzeRgbaLuminanceHistogram()).structRgbaLuminanceMetrics — Display-space luminance statistics of an RGBA8 image (RayraiWindow::analyzeRgbaLuminance()).structRgbaOutputTransform — CPU color transform for screenshots/reports (RayraiWindow::transformRgbaForOutput()).structRsceneRenderSettings — Render settings stored in a scene's environment, weather and rayrai_render records, with RaiSim Engine 2's defaults for what the file omits.structRsceneVisuals — Viewer objects created for a scene (see rsceneVisuals()).
Renderer S–T
structSceneImportReport — Outcome of RayraiWindow::importVisualScene() (mesh load and optional light import).classScopedActiveTexture — RAII guard for glActiveTexture.classScopedCapability — RAII guard that enables or disables a GL capability and restores its previous state.classScopedClearColor — RAII guard for glClearColor.classScopedDepthFunc — RAII guard for glDepthFunc.classScopedDepthMask — RAII guard for glDepthMask.classScopedDrawBuffer — RAII guard that sets a single draw buffer and restores up to eight previous draw buffers.classScopedFramebuffer — RAII guard that binds a framebuffer and restores the previous binding of the same target.classScopedPixelUnpackBufferZero — Binds GL_PIXEL_UNPACK_BUFFER to 0 for the guard's lifetime, restoring the previous binding on destruction.classScopedReadBuffer — RAII guard for glReadBuffer.classScopedTightPixelUnpack — RAII guard that sets tightly packed GL unpack state (alignment 1, no row length/skips) and restores it.classScopedViewport — RAII guard for glViewport.classScreenSpaceDepthCopySystem — Owns a depth-texture copy of the opaque scene depth for transparent material effects that need to compare against already-rendered geometry without sampling the active depth attachment.classScreenSpaceRefractionSystem — Owns the opaque-color copy texture used by the screen-space refraction lookup. Reallocated automatically when the scene target size changes.structShaderWarmupDiagnostics — Built-in shader compile statistics (RayraiWindow::shaderWarmupDiagnostics()).structShadowAtlasPlan — Row-packed tile layout of the additional-light shadow atlas (RayraiWindow::planAdditionalShadowAtlas()).structShadowAtlasTile — One tile of a ShadowAtlasPlan. Pixel values are atlas texels.structShadowDebugOverlaySummary — CPU summary shown by the optional shadow debug overlay (RayraiWindow::shadowDebugOverlaySummary()).classSkyAtmosphereSystem — Owner of the Hillaire sky-atmosphere LUT pipeline (transmittance, multi-scattering, sky-view, aerial-perspective volume).structSkyVisibilityGrid — Static, scalar environment visibility, x fastest, then y, then z. 1 = open environment; 0 = occluded.classStreamedFoliage — Owns per-cell/species batches while the viewer retains shared mesh/texture assets.classStreamedTerrain — A complete visual terrain cover with small patches near observers and coarse patches toward the horizon.structSupersampledCapture — Result of RayraiWindow::captureSupersampledRgba(): a frame rendered at scale times the camera resolution and box-filtered back down.classTerrainPatch — CPU terrain geometry, sampled once at full resolution and decimated per patch.structTerrainPatchLevel — One level of detail of a TerrainPatch.structTerrainPatchRegion — One quadtree node of a terrain layout.classTextureBindingCacheView — Internal: hot-loop handle to the calling thread's texture caches.structTransparentDrawDebugView — Transparent-pass state and draw order for a camera (RayraiWindow::transparentDrawDebugView()). Diagnostic only.structTransparentDrawItem — One transparent draw in a TransparentDrawDebugView.
Renderer V–W
classVisuals — Renderable visual object not owned by raisim::World.structWeatherDiagnostics — Resolved weather state for the current frame (RayraiWindow::weatherDiagnostics()).structWeatherSettings — Weather state applied on top of the renderer (RayraiWindow::setWeatherSettings()).structWeatherSidecarSettings — Weather state read from a scene's weather sidecar JSON (<scene>.rayrai_weather.json, see RayraiWindow::loadWeatherSidecar()).structWeatherSkyEnvironment — Sky cubemaps baked from the current weather (RayraiWindow::generateWeatherSkyEnvironment()).classWeightedOitSystem — Owns the GL resources for weighted-blended order-independent transparency (Meshkin / McGuire-Bavoil): an RGBA16F accumulation target, an R16F reveal target, an RGBA8 opaque-color target, and a…structWorldCellBounds — Axis-aligned rectangle on the horizontal (x,y) plane.structWorldCellKey — Integer cell coordinate; (0,0) is the cell at the world's minimum corner.structWorldCellPlan — Result of WorldCells::plan().classWorldCells — Bounded cell residency planning, independent of rendering and physics.structWorldInterest — A point that wants nearby cells resident (camera, sensor or body).
Enumerations
GeometryRefractionBackend
#include <rayrai/GeometryRefraction.hpp>
enum class GeometryRefractionBackendTracing backend requested for opt-in geometry refraction (RenderQualitySettings::geometryRefraction).
Automatic: use Vulkan hardware ray queries when available; otherwise (or if they fail) trace in OpenGL.Portable: always use the portable OpenGL tracer.VulkanRayQuery: require Vulkan hardware ray queries; rendering throws instead of falling back.
| Enumerator |
|---|
Automatic |
Portable |
VulkanRayQuery |
LightType
#include <rayrai/Light.hpp>
enum class LightTypeLight type selector for shading.
| Enumerator | Value | Description |
|---|---|---|
DIRECTIONAL | 0 | Infinitely distant light along direction; no attenuation. |
POINT | 1 | Omnidirectional light at position (cubemap shadows). |
SPOT | 2 | Cone light at position aimed along direction. |
AREA | 3 | Rectangle at position spanned by areaRight/areaUp, emitting along direction. |
MeshPreprocessLodFlavor
#include <rayrai/MeshPreprocessCache.hpp>
enum class MeshPreprocessLodFlavorKind of LOD chain; each flavor is cached in its own file.
| Enumerator |
|---|
Visual |
Instanced |
FoliagePartitioned |
Foliage |
RenderQualityPreset
#include <rayrai/RenderQuality.hpp>
enum class RenderQualityPresetViewer-quality policy presets (RenderQualitySettings::preset()).
These presets affect interactive viewer rendering only. They do not change sensor world-object filtering or make sensor outputs include viewer-only visuals.
| Enumerator | Value | Description |
|---|---|---|
Fast | 0 | Simple (non-PBR) shading, texture clouds, no reflective ground. |
Balanced | 1 | PBR + IBL with ACES tone mapping, texture clouds, reflective ground; no MSAA/SSAO/DoF/TAA. |
High | 2 | Adds 2x MSAA, volumetric clouds, SSAO, DoF, FXAA, probe filtering, two shadowed lights. |
Ultra | 3 | High plus 4x MSAA, AgX tone curve, TAA, larger shadow maps and probe filters. |
Custom | 4 | Struct defaults plus texture clouds; also reported after any manual settings change. |
ViewerColorMode
#include <rayrai/RenderQuality.hpp>
enum class ViewerColorModeTone curve applied when RenderQualitySettings::pbrToneMapping is enabled.
With tone mapping disabled the mode has no effect.
| Enumerator | Value | Description |
|---|---|---|
FastLinear | 0 | Currently uses the same fitted ACES curve as AcesApprox. |
AcesApprox | 1 | Fitted ACES filmic curve. |
UnrealPreviewApprox | 2 | ACES with slight shadow lift and highlight desaturation. |
FilmicApprox | 3 | Hejl/Burgess-Dawson style filmic curve. |
AgXApprox | 4 | AgX-style log curve; hue-preserving and neutral. |
ColorGradePreset
#include <rayrai/RenderQuality.hpp>
enum class ColorGradePresetASC-CDL color grade presets applied at the end of the post-process chain.
These are stylistic; Neutral is a no-op. Strength is mixed with the ungraded color via viewerColorGradeStrength.
| Enumerator | Value | Description |
|---|---|---|
Neutral | 0 | No grading. |
Warm | 1 | Warm highlights, slight teal shadows. |
Cool | 2 | Cyan/blue cast. |
Cinematic | 3 | Teal shadows, orange highlights. |
Bleach | 4 | Low saturation, slight green push (bleach bypass). |
CloudQuality
#include <rayrai/RenderQuality.hpp>
enum class CloudQualityProcedural cloud rendering path (RenderQualitySettings::cloudQuality).
Presets pick Texture for Fast, Balanced and Custom and Volumetric for High and Ultra. Enabled weather promotes Off to Texture when it shows a cloud layer.
| Enumerator | Value | Description |
|---|---|---|
Off | 0 | No clouds (sky only). |
Texture | 1 | Cheap 2D cloud texture sampled at a ray-plane intersection. |
Volumetric | 2 | Raymarched 3D noise with sun scattering. |
GlowBlendMode
#include <rayrai/RenderQuality.hpp>
enum class GlowBlendModeHow bloom (glow) is combined with the scene color.
| Enumerator | Value | Description |
|---|---|---|
Additive | 0 | color + glow. |
Screen | 1 | Screen blend. |
Softlight | 2 | Soft-light blend. |
Replace | 3 | Output the glow only. |
Mix | 4 | color * (1 - bloomMix) + glow. |
ViewerUpscaleFilter
#include <rayrai/RenderQuality.hpp>
enum class ViewerUpscaleFilterFilter used to upscale the viewer image when viewerRenderScale is below 1.
| Enumerator | Value | Description |
|---|---|---|
Linear | 0 | Bilinear. |
Mitchell | 1 | Mitchell-Netravali bicubic. |
TemporalAaMethod
#include <rayrai/RenderQuality.hpp>
enum class TemporalAaMethodLegacy blends display history; Reprojected accumulates jittered scene color with camera/foliage-wind reprojection, depth rejection and variance clipping. The native-resolution reprojected method uses a single-sample scene target.
Legacy uses temporalAaBlend as its history weight; Reprojected uses temporalAaCurrentWeight and forces viewerMsaaSamples to 1 while temporal AA is on.
| Enumerator | Value |
|---|---|
Legacy | 0 |
Reprojected | 1 |
PostProcessDebugMode
#include <rayrai/RenderQuality.hpp>
enum class PostProcessDebugModeDebug views that replace the final post-processed image.
| Enumerator | Value | Description |
|---|---|---|
Final | 0 | Normal output. |
BloomSource | 1 | Thresholded bloom source. |
AmbientOcclusion | 2 | Denoised ambient occlusion. |
AmbientOcclusionRaw | 3 | Ambient occlusion before denoising. |
FogTransmittance | 4 | Fog transmittance. |
FogDensity | 5 | Volumetric fog density. |
FogScattering | 6 | Volumetric in-scattering. |
WorldNormal | 7 | World normal reconstructed from depth. |
DepthHeatmap | 8 | Linear depth as a heat map. |
ScreenSpaceIndirectLighting | 9 | Screen-space indirect lighting term. |
PointShadowPolicy
#include <rayrai/RenderQuality.hpp>
enum class PointShadowPolicyShadowing policy for point lights selected as additional shadow casters.
| Enumerator | Value | Description |
|---|---|---|
Disabled | 0 | Point lights never get shadow maps. |
StandaloneCubemap | 1 | Point lights use their own 6-face depth cubemap. |
VisualCategory
#include <rayrai/VisualCategory.hpp>
enum class VisualCategoryRender-category flag for user-created visuals and point clouds.
VisualCategory is render metadata. Rayrai uses it when a render policy asks for only capture/detection-visible helper geometry, for example external camera renders, capture paths that reuse external-camera rendering, detectable-only point-cloud rendering, and picking or shadow candidate passes that explicitly require detectable visualization objects.
This flag does not create a physics body, collision shape, dynamics object, or semantic label, and it does not hide an object from the normal interactive viewer. User-created Visuals, InstancedVisuals, PointCloud, and helpers built on top of Visuals default to NotDetectable so debug overlays, camera frustums, axes, labels, and other viewer-only aids do not contaminate external-camera or generated capture images.
Set a visual to Detectable when it should be included in those capture/detection render passes. RaiSim world objects are not controlled by this enum; they follow their own wrapper visibility and the active render pass policy. The RaiSim RGB/depth sensor-camera overloads intentionally disable custom visualization objects and point clouds regardless of this flag.
| Enumerator | Value | Description |
|---|---|---|
NotDetectable | 0 | Viewer-only by default; excluded from detectable-only render passes. |
Detectable | 1 | Included when a rayrai render policy asks for detectable custom visuals. |
WeatherPreset
#include <rayrai/Weather.hpp>
enum class WeatherPresetNamed weather configurations produced by RayraiWindow::defaultWeatherSettings().
Every preset except Custom enables weather at High quality, 13:00 local time (Snow 12:00, Storm 15:00, NightClear 22:00, NightRain 23:00) with wetness accumulation on, and sets cloud, fog, precipitation, wetness, wind and turbidity values for the named look.
| Enumerator | Value | Description |
|---|---|---|
Clear | 0 | Almost cloudless, no fog or precipitation. |
Hazy | 1 | Light clouds, warm haze (1.4 km visibility). |
Overcast | 2 | Full grey cloud deck, light fog. |
Fog | 3 | Dense fog (160 m visibility). |
Rain | 4 | Moderate rain, wet surfaces. |
HeavyRain | 5 | Heavy rain, fully wet surfaces, stronger wind. |
Snow | 6 | Snowfall with snow cover and bright ground albedo. |
Storm | 7 | Heavy rain with lightning and strong wind. |
NightClear | 8 | Clear night sky. |
NightRain | 9 | Rain at night. |
Custom | 10 | User-defined; defaultWeatherSettings(Custom) returns weather disabled. |
WeatherQuality
#include <rayrai/Weather.hpp>
enum class WeatherQualityCost tier of the weather effects.
Low has no cloud layer and no precipitation particles. Medium adds the cloud layer and particles. High adds cloud shadows, lightning and lens droplets. Ultra adds volumetric fog and the largest particle budget.
| Enumerator | Value | Description |
|---|---|---|
Low | 0 | No clouds or precipitation particles. |
Medium | 1 | Cloud layer and particles (1x budget). |
High | 2 | Plus cloud shadows, lightning and lens droplets (2x budget). |
Ultra | 3 | Plus volumetric fog (4x budget). |
Type aliases
IrradianceProbe
#include <rayrai/BakedIrradiance.hpp>
using IrradianceProbe = std::array<glm::vec4, 3>First-order spherical harmonics, convolved with cosine / pi. Each RGB channel stores (constant, x, y, z); evaluate dot(channel, vec4(1, normal)). Radiance and coefficients are linear, scene-referred, before exposure.
MeshList
#include <rayrai/helper.hpp>
using MeshList = std::shared_ptr<std::vector<std::shared_ptr<OpenGLMesh>>>Convenience alias for a shared list of meshes returned by the GenMesh* helpers and consumed by Visuals/RaisimObject constructors.
The nested shared_ptr layout exists so that multiple visuals can share an underlying mesh set without copying the vector. Prefer this alias to the long nested type in new code.
Functions
accumulateIrradiance
#include <rayrai/BakedIrradiance.hpp>
void accumulateIrradiance(
IrradianceProbe &probe,
const glm::vec3 &radiance,
const glm::vec3 &direction,
float weight)deringIrradiance
#include <rayrai/BakedIrradiance.hpp>
void deringIrradiance(IrradianceProbe &probe)supportsBc7TextureStorage
#include <rayrai/Bc7TextureStorage.hpp>
bool supportsBc7TextureStorage()True if the current context can store BC7 textures. Desktop GL 4.2 or the equivalent extension; unsupported contexts keep RGB8. No architecture-specific encoder, compute shader or worker thread is needed.
compressRgbTextureBc7
#include <rayrai/Bc7TextureStorage.hpp>
Bc7TextureStorageResult compressRgbTextureBc7(unsigned int texture)Re-encode a GL_TEXTURE_2D in place as BC7, using the driver's encoder. Loading-time, in-place storage optimization for owned, mutable RGB8/SRGB8 material textures. Alpha, depth, float, immutable and already compressed textures are left intact. Preserve every authored mip, filtering and texture ID. References to the implicit RGB alpha channel keep sampling exactly one. The driver's BC7 encoder is lossy; validate assets before enabling this policy. Requires a current GL context. Unsupported/ineligible textures return zero. GL bindings and pixel-store state are restored on return.
buildFoliageGeometryAtlasForMeshes
#include <rayrai/FoliageGeometryAtlas.hpp>
FoliageGeometryAtlasResult buildFoliageGeometryAtlasForMeshes(
const std::shared_ptr<std::vector<std::shared_ptr<OpenGLMesh>>> &meshes,
const FoliageGeometryAtlasOptions &options={})Merge a multi-mesh foliage model into one vertex/index buffer.
Applies only when every mesh is a foliage-atlas candidate with compatible materials (at least two meshes). On success meshes is replaced in place by indexed-range views of a single atlas mesh, so the model can be drawn without rebinding buffers; otherwise it is left unchanged.
Parameters
| Parameter | Description |
|---|---|
meshes | Mesh list to rewrite. |
options | Warning behavior. |
Returns What was done and why not, if skipped.
buildCoveragePreservingFoliageLods
#include <rayrai/FoliageGeometryLods.hpp>
std::array<std::shared_ptr<std::vector<std::shared_ptr<OpenGLMesh>>>, 6> buildCoveragePreservingFoliageLods(
const InstancedVisuals &source,
bool cpuOnly=false,
std::array<float, 6> targetRatios={.62f,.38f,.22f,.10f,.035f,.002f})Build six simplified LOD mesh lists from a foliage visual's prepared LOD 0. Real source geometry, with disconnected component extents and projected surface area protected. No directional texture captures or material baking. Moderate loss on small surviving pieces uses bounded growth inside source bounds; missing pieces retain original triangles. This is not a bound on the final alpha-masked screen silhouette. With cpuOnly=false, call on the owning GL thread with prepared source meshes. cpuOnly=true can run on a worker while the source remains immutable; upload generated meshes on the owning GL thread before installing the chain. Preserving tiny leaf pieces can limit reduction; measure the resulting cost.
Parameters
| Parameter | Description |
|---|---|
source | Visual with prepared, opaque or alpha-masked triangle meshes. |
cpuOnly | Produce CPU-only meshes (see above). |
targetRatios | Target index-count ratio per level; non-increasing, in (0, 1]. |
Returns One mesh list per LOD level, for InstancedVisuals::setPreparedMeshLods().
Exceptions
| Exception | Description |
|---|---|
std::invalid_argument | for unprepared or unsupported source geometry or bad ratios. |
buildFoliageTextureAtlasForMeshes
#include <rayrai/FoliageTextureAtlas.hpp>
FoliageTextureAtlasResult buildFoliageTextureAtlasForMeshes(
const std::shared_ptr<std::vector<std::shared_ptr<OpenGLMesh>>> &meshes,
const FoliageTextureAtlasOptions &options={})Pack the albedo (and normal) textures of foliage meshes into one atlas.
Needs a current GL context. Requires at least two eligible meshes with two distinct albedo textures; eligible meshes have default UV transforms and UVs inside [0,1]. Rewritten meshes have their texture coordinates remapped into their atlas tile and reference the atlas textures.
Parameters
| Parameter | Description |
|---|---|
meshes | Mesh list whose materials are rewritten in place. |
options | Packing and warning options. |
Returns Atlas handles and statistics.
requireCompleteFramebuffer
#include <rayrai/FramebufferValidation.hpp>
void requireCompleteFramebuffer(const char *label)Throw std::runtime_error naming label if the bound GL_FRAMEBUFFER is incomplete.
logGlErrors
#include <rayrai/GlStateGuard.hpp>
void logGlErrors(const char *label, const char *file, int line)Drain and print pending GL errors when RAYRAI_LOG_GL_ERRORS is set to a non-empty value other than "0" (debug builds only; use RAYRAI_GL_CHECK).
additionalLightInfluenceRange
#include <rayrai/LightInfluence.hpp>
LightInfluenceRange additionalLightInfluenceRange(
const AdditionalLight &light,
float budget,
const glm::vec3 &colorScale=glm::vec3(1.f))Conservative spherical influence range for a local additional light. budget is this light's share of the incident-radiance budget, not a final-pixel error tolerance. colorScale includes tint, fade and intensity. Directional, non-decaying, ambient-bearing or invalid lights stay unlimited. Existing Light::radius (source-size semantics) is intentionally untouched.
meshPreprocessCacheEnabled
#include <rayrai/MeshPreprocessCache.hpp>
bool meshPreprocessCacheEnabled()Returns Always true; the cache cannot be disabled.
resetMeshPreprocessCacheStats
#include <rayrai/MeshPreprocessCache.hpp>
void resetMeshPreprocessCacheStats()Zero all counters returned by meshPreprocessCacheStatsSnapshot().
meshPreprocessCacheStatsSnapshot
#include <rayrai/MeshPreprocessCache.hpp>
MeshPreprocessCacheStats meshPreprocessCacheStatsSnapshot()Returns Current counter values.
computeMeshPreprocessMetadata
#include <rayrai/MeshPreprocessCache.hpp>
MeshPreprocessMetadata computeMeshPreprocessMetadata(const std::vector<std::shared_ptr<OpenGLMesh>> &meshes)Scan meshes for counts, bounds and material flags.
Returns Metadata; MeshPreprocessMetadata::valid is false for empty geometry.
recordMeshPreprocessImportSources
#include <rayrai/MeshPreprocessCache.hpp>
void recordMeshPreprocessImportSources(
const std::string &canonicalKey,
const std::vector<assimp::ModelSourceFile> &files)Record source snapshots taken during import. A changed import cannot publish stale results.
loadMeshPreprocessMetadata
#include <rayrai/MeshPreprocessCache.hpp>
bool loadMeshPreprocessMetadata(
const std::string &canonicalKey,
MeshPreprocessMetadata &metadata)Load cached metadata for the source file canonicalKey.
Returns False on a miss or a stale/corrupt entry.
storeMeshPreprocessMetadata
#include <rayrai/MeshPreprocessCache.hpp>
bool storeMeshPreprocessMetadata(
const std::string &canonicalKey,
const MeshPreprocessMetadata &metadata)Store metadata for the source file canonicalKey.
Returns False if the metadata is not cacheable or the write failed.
loadMeshPreprocessLods
#include <rayrai/MeshPreprocessCache.hpp>
std::shared_ptr<RayraiGlobalAsset::MeshLodChain> loadMeshPreprocessLods(
const std::string &canonicalKey,
const std::vector<std::shared_ptr<OpenGLMesh>> &sourceMeshes,
MeshPreprocessLodFlavor flavor)Load a cached LOD chain built from sourceMeshes.
Returns The chain, or null on a miss or a stale/incompatible entry.
storeMeshPreprocessLods
#include <rayrai/MeshPreprocessCache.hpp>
bool storeMeshPreprocessLods(
const std::string &canonicalKey,
const std::vector<std::shared_ptr<OpenGLMesh>> &sourceMeshes,
MeshPreprocessLodFlavor flavor,
const RayraiGlobalAsset::MeshLodChain &chain)Store a LOD chain built from sourceMeshes.
Returns False for an empty chain or a failed write.
warnMeshPreprocessCacheFallbackOnce
#include <rayrai/MeshPreprocessCache.hpp>
void warnMeshPreprocessCacheFallbackOnce(
const std::string &canonicalKey,
uint32_t code,
const std::string &detail={})Print a cache fallback warning once per (key, code, detail). Code 0 is ignored; RAYRAI_SUPPRESS_MESH_PREPROCESS_CACHE_FALLBACK_WARNINGS silences all.
envFlagEnabled
#include <rayrai/RayraiEnv.hpp>
bool envFlagEnabled(const char *name)True if environment variable name is set to a non-empty value not starting with '0'.
envIntValue
#include <rayrai/RayraiEnv.hpp>
int envIntValue(const char *name, int fallback=0)Leading base-10 integer of environment variable name, or fallback if unset or not numeric.
syncRaisimCameraPose
#include <rayrai/RayraiWindow.hpp>
template <typename RaisimCamT>
void syncRaisimCameraPose(RaisimCamT &sensorCam, Camera &renderCam)Synchronizes a rayrai render camera's pose with a raisim sensor camera.
Template parameters
| Parameter | Description |
|---|---|
RaisimCamT | The type of the raisim sensor camera (e.g., raisim::RGBCamera). |
Parameters
| Parameter | Description |
|---|---|
sensorCam | The source raisim camera. Its pose will be updated and read. |
renderCam | The destination rayrai camera. Its position, front, up and right vectors will be set. |
Note
This function directly sets the position, front, up and right vectors of the renderCam. Calling renderCam.update() after this may lead to unexpected behavior, as update() recalculates orientation from yaw and pitch angles, which are not updated by this function. This function is intended for use cases where the camera's view matrix is used directly after synchronization, without an intermediate update() call.
rayraiProcessIsMultiThreaded
#include <rayrai/RayraiWindow.hpp>
bool rayraiProcessIsMultiThreaded()Process-wide query: is the current rayrai installation running in multi-threaded mode (one RayraiWindow per worker thread)?
Returns true once the first RayraiWindow of the process was constructed with ThreadingMode::MultiThread (the first window fixes the mode), false before any window exists or in SingleThread mode. Nothing inside rayrai branches on this: rayrai's GL-state caches do not depend on the mode, because worker asset creation can touch that state before any window exists and so before the mode is known. It remains as the declared contract — construction still rejects a process whose renderers disagree — and as a query for applications that need to know which contract they are under.
Returns True in MultiThread mode.
rsceneRenderSettings
#include <rayrai/RsceneVisuals.hpp>
RsceneRenderSettings rsceneRenderSettings(const raisim::rscene::Scene &scene)Reads the scene's render settings; throws std::runtime_error when a record is malformed. Omitted records and keys take RaiSim Engine 2's defaults.
setRsceneRenderSettings
#include <rayrai/RsceneVisuals.hpp>
void setRsceneRenderSettings(
RayraiWindow &viewer,
const RsceneRenderSettings &render)Shows the viewer's world scene with these render settings instead of the file's, usually the file's own (rsceneRenderSettings()) after C++ changes. The scene is applied again in place of the constructor's application; its meshes are reused. Fatal when the viewer's world holds no scene.
rsceneVisuals
#include <rayrai/RsceneVisuals.hpp>
const RsceneVisuals &rsceneVisuals(const RayraiWindow &viewer)The visuals and batches the viewer created for its world's scene. Empty when the viewer's world holds no scene.
terrainPatchLayout
#include <rayrai/TerrainPatchLayout.hpp>
std::vector<TerrainPatchRegion> terrainPatchLayout(
WorldCellBounds world,
std::span<const glm::dvec2> observers,
double finestPatchSize=32,
double splitScale=1.5,
size_t patchBudget=2048)A complete terrain cover: small patches around each observer, large ones toward the horizon. The returned regions partition the world without holes.
A node is split while it is wider than finestPatchSize and some observer lies within width * splitScale of it.
Exceptions
| Exception | Description |
|---|---|
std::invalid_argument | for non-finite or empty inputs. |
std::length_error | when more than patchBudget regions are needed. |
textureBindingState
#include <rayrai/TextureBindingCache.hpp>
detail::TextureBindingState &textureBindingState()textureStateCache
#include <rayrai/TextureBindingCache.hpp>
detail::TextureStateCache &textureStateCache()activateTextureCacheContext
#include <rayrai/TextureBindingCache.hpp>
void activateTextureCacheContext(uint64_t generation)textureObjectExistsCached
#include <rayrai/TextureBindingCache.hpp>
bool textureObjectExistsCached(unsigned int textureId)markTextureObjectExistsCached
#include <rayrai/TextureBindingCache.hpp>
void markTextureObjectExistsCached(unsigned int textureId, bool exists=true)textureSamplerStatePrepared
#include <rayrai/TextureBindingCache.hpp>
bool textureSamplerStatePrepared(
unsigned int textureId,
std::uint64_t samplerKey)markTextureSamplerStatePrepared
#include <rayrai/TextureBindingCache.hpp>
void markTextureSamplerStatePrepared(
unsigned int textureId,
std::uint64_t samplerKey)invalidateTextureStateCacheForTexture
#include <rayrai/TextureBindingCache.hpp>
void invalidateTextureStateCacheForTexture(unsigned int textureId)invalidateFallbackTextureVerification
#include <rayrai/TextureBindingCache.hpp>
void invalidateFallbackTextureVerification()resetTextureBindingCache
#include <rayrai/TextureBindingCache.hpp>
void resetTextureBindingCache()Forget all cached unit bindings (call after any GL texture binding done outside these helpers).
invalidateTextureBindingCacheForTexture
#include <rayrai/TextureBindingCache.hpp>
void invalidateTextureBindingCacheForTexture(unsigned int textureId)invalidateTextureBindingCacheForTextures
#include <rayrai/TextureBindingCache.hpp>
void invalidateTextureBindingCacheForTextures(
gl::GLsizei count,
const unsigned int *textureIds)deleteTextureNameAndInvalidateCache
#include <rayrai/TextureBindingCache.hpp>
void deleteTextureNameAndInvalidateCache(unsigned int textureId)deleteTextureAndInvalidateCache
#include <rayrai/TextureBindingCache.hpp>
void deleteTextureAndInvalidateCache(unsigned int &textureId)Delete a texture, drop it from the calling thread's caches, and set textureId to 0. Use instead of raw glDeleteTextures so a recycled id is not mistaken for a cached binding.
deleteTexturesAndInvalidateCache
#include <rayrai/TextureBindingCache.hpp>
void deleteTexturesAndInvalidateCache(
gl::GLsizei count,
const unsigned int *textureIds)fallbackWhiteTexture2D
#include <rayrai/TextureBindingCache.hpp>
unsigned int fallbackWhiteTexture2D()Returns Lazily created 1x1 opaque-white 2D texture for the current context (owned by the cache).
fallbackWhiteTextureCube
#include <rayrai/TextureBindingCache.hpp>
unsigned int fallbackWhiteTextureCube()Returns Lazily created 1x1 opaque-white cubemap for the current context (owned by the cache).
fallbackWhiteTexture3D
#include <rayrai/TextureBindingCache.hpp>
unsigned int fallbackWhiteTexture3D()Returns Lazily created 1x1x1 opaque-white 3D texture for the current context (owned by the cache).
bindTextureIfNeeded
#include <rayrai/TextureBindingCache.hpp>
void bindTextureIfNeeded(
int unit,
gl::GLenum target,
unsigned int textureId)Free-function form of TextureBindingCacheView::bindTexture().
bindTexture2DIfNeeded
#include <rayrai/TextureBindingCache.hpp>
void bindTexture2DIfNeeded(int unit, unsigned int textureId)bindTexture2DWithFallbackIfNeeded
#include <rayrai/TextureBindingCache.hpp>
void bindTexture2DWithFallbackIfNeeded(int unit, unsigned int textureId)Bind a 2D texture, substituting fallbackWhiteTexture2D() for id 0.
bindTextureCubeIfNeeded
#include <rayrai/TextureBindingCache.hpp>
void bindTextureCubeIfNeeded(int unit, unsigned int textureId)bindTextureCubeWithFallbackIfNeeded
#include <rayrai/TextureBindingCache.hpp>
void bindTextureCubeWithFallbackIfNeeded(int unit, unsigned int textureId)Bind a cube map, substituting fallbackWhiteTextureCube() for id 0.
bindTexture3DIfNeeded
#include <rayrai/TextureBindingCache.hpp>
void bindTexture3DIfNeeded(int unit, unsigned int textureId)toGlm
#include <rayrai/helper.hpp>
glm::dvec3 toGlm(const raisim::Vec<3> &v)Convert a raisim::Vec<3> to a GLM vector.
Parameters
| Parameter | Description |
|---|---|
v | Raisim vector in world coordinates. |
Returns GLM vector with the same components.
glm::dmat3 toGlm(const raisim::Mat<3, 3> &R)Convert a raisim::Mat<3,3> to a GLM matrix.
Parameters
| Parameter | Description |
|---|---|
R | Raisim rotation matrix (column-major). |
Returns GLM matrix with the same column-major layout.
GenMeshCube
#include <rayrai/helper.hpp>
MeshList GenMeshCube(float width, float height, float length)Generate a cube mesh centered at the origin.
Parameters
| Parameter | Description |
|---|---|
width | Cube size along X. |
height | Cube size along Y. |
length | Cube size along Z. |
Returns Shared mesh list containing a single cube mesh.
GenMeshPlane
#include <rayrai/helper.hpp>
MeshList GenMeshPlane(
float width,
float height,
float uTiling=1.0f,
float vTiling=1.0f,
int subdivisions=1)Generate a plane mesh centered at the origin on the XY plane.
Parameters
| Parameter | Description |
|---|---|
width | Plane size along X. |
height | Plane size along Y. |
uTiling | Texture tiling factor in U. |
vTiling | Texture tiling factor in V. |
subdivisions | NxN grid of quads. Tessellating a large plane bounds the clip-W ratio across each triangle, which is what perspective-correct interpolation needs for stable fp32 precision — a single huge quad degrades vPosWS at grazing angles and corrupts both the procedural checker and planar-reflection UV sampling. |
Returns Shared mesh list containing a single plane mesh.
GenMeshSphere
#include <rayrai/helper.hpp>
MeshList GenMeshSphere(float radius, int rings, int sectors)Generate a UV sphere mesh.
Parameters
| Parameter | Description |
|---|---|
radius | Sphere radius. |
rings | Number of latitude rings. |
sectors | Number of longitude sectors. |
Returns Shared mesh list containing a single sphere mesh.
GenMeshCylinder
#include <rayrai/helper.hpp>
MeshList GenMeshCylinder(float radius, float height, int sectors)Generate a cylinder mesh oriented along Z.
Parameters
| Parameter | Description |
|---|---|
radius | Cylinder radius. |
height | Cylinder height. |
sectors | Number of radial sectors. |
Returns Shared mesh list containing a single cylinder mesh.
GenMeshCapsule
#include <rayrai/helper.hpp>
MeshList GenMeshCapsule(float radius, float height, int sectors)Generate a capsule mesh oriented along Z.
Parameters
| Parameter | Description |
|---|---|
radius | Capsule radius. |
height | Capsule height (cylinder portion). |
sectors | Number of radial sectors. |
Returns Shared mesh list containing a single capsule mesh.
HeightmapVisualSampleCountForAxis
#include <rayrai/helper.hpp>
int HeightmapVisualSampleCountForAxis(
int sourceSamples,
float worldSizeMeters)Choose visual heightmap samples for one axis without changing physics samples.
When source cells are coarser than 0.25 m, upsamples by an integer factor toward 0.25 m visual cells. The result never exceeds 769 samples per axis; inputs with at most 2 samples or a non-positive size are returned unchanged.
Parameters
| Parameter | Description |
|---|---|
sourceSamples | Number of source heightmap samples on the axis. |
worldSizeMeters | Physical size of the axis in metres. |
Returns Visual sample count for rayrai rendering.
HeightmapVisualSampleCounts
#include <rayrai/helper.hpp>
glm::ivec2 HeightmapVisualSampleCounts(
const std::vector<double> &height,
int samplesX,
int samplesY,
float sizeX,
float sizeY)Choose heightmap visual grid dimensions while preserving non-finite source holes.
A grid containing NaN or infinity uses its source triangulation unchanged, so only triangles containing invalid source samples are omitted. Finite grids retain the normal visual tessellation and sample budget.
glm::ivec2 HeightmapVisualSampleCounts(
const std::vector<float> &height,
int samplesX,
int samplesY,
float sizeX,
float sizeY)Float-sample overload used by streamed heightmaps.
BuildHeightmapTriangleIndices
#include <rayrai/helper.hpp>
std::vector<unsigned int> BuildHeightmapTriangleIndices(
int samplesX,
int samplesY)Build row-major heightmap triangles using the physics anti-diagonal.
Parameters
| Parameter | Description |
|---|---|
samplesX | Vertices per row. |
samplesY | Number of rows. |
Returns Triangle-list indices (empty if either count is below 2).
RemoveInvalidHeightmapTriangles
#include <rayrai/helper.hpp>
void RemoveInvalidHeightmapTriangles(
std::vector<Vertex> &vertices,
std::vector<unsigned int> &indices)Remove heightmap triangles touching NaN or infinite heights.
Invalid, now unused vertex heights are replaced with zero for finite GPU geometry and bounds. The source height samples are not modified.
Parameters
| Parameter | Description |
|---|---|
vertices | Row-major rendered heightmap vertices. |
indices | Triangle-list indices into the vertices. |
SampleHeightmapTriangulated
#include <rayrai/helper.hpp>
float SampleHeightmapTriangulated(
const std::vector<double> &height,
int samplesX,
int samplesY,
float sourceX,
float sourceY)Interpolate a row-major height grid on the same triangulation as BuildHeightmapTriangleIndices().
Parameters
| Parameter | Description |
|---|---|
height | Heights, x fastest. |
samplesX | Samples per row. |
samplesY | Number of rows. |
sourceX | Fractional sample coordinate along x (clamped to the grid). |
sourceY | Fractional sample coordinate along y (clamped to the grid). |
Returns Interpolated height, or 0 for an invalid grid.
float SampleHeightmapTriangulated(
const std::vector<float> &height,
int samplesX,
int samplesY,
float sourceX,
float sourceY)Float-sample overload used by streamed heightmaps.
FillHeightmapVerticesRaisim
#include <rayrai/helper.hpp>
bool FillHeightmapVerticesRaisim(
raisim::HeightMap *hm,
std::vector<Vertex> &vertices)Generate heightmap vertices from a raisim heightmap without rebuilding indices/meshes.
Parameters
| Parameter | Description |
|---|---|
hm | Raisim heightmap pointer. |
vertices | Destination vertex buffer. |
Returns True when vertices were generated.
FillHeightmapVertexRowsRaisim
#include <rayrai/helper.hpp>
bool FillHeightmapVertexRowsRaisim(
raisim::HeightMap *hm,
size_t sourceMinY,
size_t sourceMaxY,
std::vector<Vertex> &vertices,
int &visualMapX,
int &visualMinY,
int &visualRowCount)Generate full-width visual vertex rows affected by an inclusive source-sample Y range.
The range is widened by a small margin so normals at the edges stay correct.
Parameters
| Parameter | Description |
|---|---|
hm | Raisim heightmap pointer. |
sourceMinY | First changed source row. |
sourceMaxY | Last changed source row. |
vertices | Output vertices for the visual rows, row-major. |
visualMapX | Output visual samples per row. |
visualMinY | Output first visual row written. |
visualRowCount | Output number of visual rows written. |
Returns False for a null or invalid heightmap.
HeightmapVisualRowsOfSourceRows
#include <rayrai/helper.hpp>
glm::ivec2 HeightmapVisualRowsOfSourceRows(
int sourceRows,
int visualRows,
size_t sourceMinY,
size_t sourceMaxY)Visual rows whose vertices depend on an inclusive source-sample Y range.
Includes the margin FillHeightmapVertexRowsRaisim() refills, so normals at the edges stay correct.
Parameters
| Parameter | Description |
|---|---|
sourceRows | Source samples along Y. |
visualRows | Visual samples along Y. |
sourceMinY | First changed source row. |
sourceMaxY | Last changed source row. |
Returns First and last affected visual row.
FillHeightmapVisualRowsRaisim
#include <rayrai/helper.hpp>
bool FillHeightmapVisualRowsRaisim(
raisim::HeightMap *hm,
const glm::ivec2 &visualSamples,
int firstRow,
int rowCount,
const std::function<Vertex *(int)> &rowVertices)Generate visual vertex rows of a heightmap drawn with given visual sample counts.
Idle decode workers fill rows concurrently, so rowVertices is called from several threads.
Parameters
| Parameter | Description |
|---|---|
hm | Raisim heightmap pointer. |
visualSamples | Visual samples per axis, as HeightmapVisualSampleCounts() chooses them. |
firstRow | First visual row. |
rowCount | Number of visual rows. |
rowVertices | Destination of a visual row: visualSamples.x vertices. |
Returns False for a null or invalid heightmap, or rows outside the visual grid.
GenMeshHeightmapRaisim
#include <rayrai/helper.hpp>
MeshList GenMeshHeightmapRaisim(raisim::HeightMap *hm)Generate a heightmap mesh from a raisim heightmap object. Triangles containing NaN or infinite source heights are omitted. Such maps retain the source grid so all other source triangles remain visible.
Parameters
| Parameter | Description |
|---|---|
hm | Raisim heightmap pointer. |
Returns Shared mesh list containing a single heightmap mesh.
findAsMeshFile
#include <rayrai/helper.hpp>
std::string findAsMeshFile(
const std::string &resourceDir,
const std::string &file)Resolve a mesh file path relative to a resource directory.
Tries file, then its base name, under resourceDir, its meshes/ and mesh/ subdirectories, and the same three locations one level up.
Parameters
| Parameter | Description |
|---|---|
resourceDir | Resource directory for the raisim object. |
file | Mesh file name stored in raisim. |
Returns Resolved mesh file path, or an empty string (with a stderr message) if none exists.
parseColorLiteral
#include <rayrai/helper.hpp>
std::optional<glm::vec4> parseColorLiteral(std::string_view input)Parse a numeric color literal such as "{1.0, 0.5, 0.0, 1.0}" or "1 0.5 0 1".
{, }, (, ), , and whitespace act as separators; parsing stops at any other non-numeric text. The first three numbers are taken as RGB; the optional fourth is the alpha (defaults to 1.0). If the largest RGB channel is in (1, 255], RGB (and an alpha above 1) are interpreted as 0..255 and rescaled. RGB is then clamped to [0, 1]; a non-negative alpha is clamped to [0, 1], while a negative alpha is kept as is.
Returns The parsed color, or std::nullopt if the input cannot be parsed.
parseNamedColor
#include <rayrai/helper.hpp>
std::optional<glm::vec4> parseNamedColor(std::string_view name)Look up a CSS-style named color (case-insensitive, e.g. "red", "LightGray").
Recognised names match the table used by appearanceToGlmVec4(). A leading path prefix ("foo/red") or namespace prefix ("raisim::red") is stripped before lookup, and surrounding whitespace is ignored. The reserved names "hidden" and "default" both return the fallback grey (0.7, 0.7, 0.7, 1).
Returns The matched color, or std::nullopt for unknown names.
isHiddenAppearance
#include <rayrai/helper.hpp>
bool isHiddenAppearance(std::string_view appearance)Check whether an appearance requests that an object be omitted from rendering.
The reserved values "hidden" and "invisible" are matched case-insensitively after trimming surrounding whitespace.
appearanceToGlmVec4
#include <rayrai/helper.hpp>
glm::vec4 appearanceToGlmVec4(const std::string &appearance)Converts an appearance string to a glm::vec4.
The appearance can be a named color (e.g., "red", "Blue", "LIGHTGRAY") or a string-formatted vector (e.g., "{1.0, 0.5, 0.0, 1.0}"). Named color matching is case-insensitive.
Convenience wrapper around parseColorLiteral() and parseNamedColor() — prefer those when you want to act on parse failure explicitly.
Parameters
| Parameter | Description |
|---|---|
appearance | The input string representing the color. |
Returns glm::vec4 The corresponding color vector. Returns grey (0.7, 0.7, 0.7, 1) on failure.
Variables
RAISIN_PHONG_SHADING
#include <rayrai/RayraiWindow.hpp>
constexpr int RAISIN_PHONG_SHADINGShading selector used by the mesh shader.
RAISIN_FLAT_SHADING
#include <rayrai/RayraiWindow.hpp>
constexpr int RAISIN_FLAT_SHADINGFlat shading selector used by the mesh shader.
kMaxAdditionalLights
#include <rayrai/RenderQuality.hpp>
constexpr size_t kMaxAdditionalLightsMaximum number of additional lights per window; RayraiWindow::addAdditionalLight() drops extras.
kMaxAdditionalShadowLights
#include <rayrai/RenderQuality.hpp>
constexpr size_t kMaxAdditionalShadowLightsMaximum number of additional lights that can own a shadow map at the same time.
kMaxProjectedDecals
#include <rayrai/SceneEffects.hpp>
constexpr size_t kMaxProjectedDecalsMaximum number of projected decals; RayraiWindow::addProjectedDecal() ignores extra decals.
kMaxIrradianceVolumes
#include <rayrai/SceneEffects.hpp>
constexpr size_t kMaxIrradianceVolumesMaximum number of irradiance volumes; RayraiWindow::addIrradianceVolume() ignores extra volumes.
kMaxLocalFogVolumes
#include <rayrai/Weather.hpp>
constexpr size_t kMaxLocalFogVolumesMaximum number of local fog volumes; RayraiWindow::addLocalFogVolume() ignores extra volumes.
DEPTH_VERTEX_SHADER
#include <rayrai/shaders/DepthShader.hpp>
auto DEPTH_VERTEX_SHADERVertex shader for shadow map depth rendering.
DEPTH_FRAGMENT_SHADER
#include <rayrai/shaders/DepthShader.hpp>
auto DEPTH_FRAGMENT_SHADERFragment shader for shadow map depth rendering.
DEPTH_OPAQUE_FRAGMENT_SHADER
#include <rayrai/shaders/DepthShader.hpp>
auto DEPTH_OPAQUE_FRAGMENT_SHADERFISHEYE_CAMERA_VERTEX_SHADER
#include <rayrai/shaders/FisheyeCameraShader.hpp>
static constexpr const char *FISHEYE_CAMERA_VERTEX_SHADERFISHEYE_CAMERA_FRAGMENT_SHADER
#include <rayrai/shaders/FisheyeCameraShader.hpp>
static constexpr const char *FISHEYE_CAMERA_FRAGMENT_SHADERINSTANCED_CULLING_COMPUTE_SHADER
#include <rayrai/shaders/InstancedCullingShader.hpp>
auto INSTANCED_CULLING_COMPUTE_SHADERINSTANCED_DEPTH_VERTEX_SHADER
#include <rayrai/shaders/InstancedDepthShader.hpp>
auto INSTANCED_DEPTH_VERTEX_SHADERVertex shader for instanced shadow depth rendering.
INSTANCED_OPAQUE_DEPTH_FRAGMENT_SHADER
#include <rayrai/shaders/InstancedDepthShader.hpp>
auto INSTANCED_OPAQUE_DEPTH_FRAGMENT_SHADERINSTANCED_DEPTH_FRAGMENT_SHADER
#include <rayrai/shaders/InstancedDepthShader.hpp>
auto INSTANCED_DEPTH_FRAGMENT_SHADERAlpha-aware fragment shader for instanced shadow depth rendering.
INSTANCED_MESH_VERTEX_SHADER
#include <rayrai/shaders/InstancedMeshShader.hpp>
auto INSTANCED_MESH_VERTEX_SHADERVertex shader for instanced mesh rendering.
INSTANCED_MESH_FRAGMENT_SHADER
#include <rayrai/shaders/InstancedMeshShader.hpp>
auto INSTANCED_MESH_FRAGMENT_SHADERFragment shader for instanced mesh rendering.
LENS_DROPLET_VERTEX_SHADER
#include <rayrai/shaders/LensDropletShader.hpp>
auto LENS_DROPLET_VERTEX_SHADERLENS_DROPLET_FRAGMENT_SHADER
#include <rayrai/shaders/LensDropletShader.hpp>
auto LENS_DROPLET_FRAGMENT_SHADERMESH_VERTEX_SHADER
#include <rayrai/shaders/MeshShader.hpp>
auto MESH_VERTEX_SHADERVertex shader for mesh rendering with lighting and shadow projection.
MESH_FRAGMENT_SHADER
#include <rayrai/shaders/MeshShader.hpp>
auto MESH_FRAGMENT_SHADERFragment shader for mesh rendering with lighting, shadows, and fog.
PBR_CORE_MESH_FRAGMENT_SHADER
#include <rayrai/shaders/PbrCoreMeshShader.hpp>
auto PBR_CORE_MESH_FRAGMENT_SHADERPBR_MESH_VERTEX_SHADER
#include <rayrai/shaders/PbrMeshShader.hpp>
auto PBR_MESH_VERTEX_SHADERPBR_MESH_FRAGMENT_SHADER
#include <rayrai/shaders/PbrMeshShader.hpp>
auto PBR_MESH_FRAGMENT_SHADERPICKING_VS
#include <rayrai/shaders/PickingShader.hpp>
constexpr const char *PICKING_VSVertex shader for object ID picking.
PICKING_FS
#include <rayrai/shaders/PickingShader.hpp>
constexpr const char *PICKING_FSFragment shader for object ID picking.
POINTCLOUD_VERTEX_SHADER
#include <rayrai/shaders/PointCloudShader.hpp>
auto POINTCLOUD_VERTEX_SHADERVertex shader for point cloud rendering.
POINTCLOUD_FRAGMENT_SHADER
#include <rayrai/shaders/PointCloudShader.hpp>
auto POINTCLOUD_FRAGMENT_SHADERFragment shader for point cloud rendering.
PRECIPITATION_VERTEX_SHADER
#include <rayrai/shaders/PrecipitationShader.hpp>
auto PRECIPITATION_VERTEX_SHADERPRECIPITATION_FRAGMENT_SHADER
#include <rayrai/shaders/PrecipitationShader.hpp>
auto PRECIPITATION_FRAGMENT_SHADERSKY_ATMOSPHERE_COMMON_GLSL
#include <rayrai/shaders/SkyAtmosphereCommon.hpp>
static constexpr const char *SKY_ATMOSPHERE_COMMON_GLSLSKY_LUT_VERTEX_SHADER
#include <rayrai/shaders/SkyAtmosphereLutShaders.hpp>
static constexpr const char *SKY_LUT_VERTEX_SHADERSKY_TRANSMITTANCE_LUT_FRAGMENT_HEADER
#include <rayrai/shaders/SkyAtmosphereLutShaders.hpp>
static constexpr const char *SKY_TRANSMITTANCE_LUT_FRAGMENT_HEADERSKY_TRANSMITTANCE_LUT_FRAGMENT_BODY
#include <rayrai/shaders/SkyAtmosphereLutShaders.hpp>
static constexpr const char *SKY_TRANSMITTANCE_LUT_FRAGMENT_BODYSKY_MULTISCAT_LUT_FRAGMENT_BODY
#include <rayrai/shaders/SkyAtmosphereLutShaders.hpp>
static constexpr const char *SKY_MULTISCAT_LUT_FRAGMENT_BODYSKY_AP_VOLUME_LUT_FRAGMENT_BODY
#include <rayrai/shaders/SkyAtmosphereLutShaders.hpp>
static constexpr const char *SKY_AP_VOLUME_LUT_FRAGMENT_BODYSKY_SKYVIEW_LUT_FRAGMENT_BODY
#include <rayrai/shaders/SkyAtmosphereLutShaders.hpp>
static constexpr const char *SKY_SKYVIEW_LUT_FRAGMENT_BODYSKYBOX_VERTEX_SHADER
#include <rayrai/shaders/SkyboxShader.hpp>
static constexpr const char *SKYBOX_VERTEX_SHADERSKYBOX_FRAGMENT_SHADER_HEADER
#include <rayrai/shaders/SkyboxShader.hpp>
static constexpr const char *SKYBOX_FRAGMENT_SHADER_HEADERSKYBOX_FRAGMENT_SHADER_BODY
#include <rayrai/shaders/SkyboxShader.hpp>
static constexpr const char *SKYBOX_FRAGMENT_SHADER_BODYSKYBOX_FRAGMENT_SHADER_SOURCE
#include <rayrai/shaders/SkyboxShader.hpp>
const std::string SKYBOX_FRAGMENT_SHADER_SOURCESKYBOX_FRAGMENT_SHADER
#include <rayrai/shaders/SkyboxShader.hpp>
const char *SKYBOX_FRAGMENT_SHADERWEIGHTED_OIT_COMPOSITE_VERTEX_SHADER
#include <rayrai/shaders/WeightedOitShader.hpp>
auto WEIGHTED_OIT_COMPOSITE_VERTEX_SHADERWEIGHTED_OIT_COMPOSITE_FRAGMENT_SHADER
#include <rayrai/shaders/WeightedOitShader.hpp>
auto WEIGHTED_OIT_COMPOSITE_FRAGMENT_SHADER