Sets per-entity quad ray fade distance (ray intensity fades based on camera distance from source).
Takes quadrayEntity (quad ray source entity handle), startFade (distance where fade begins in world units), falloff (fade rate, distance from startFade to full fade).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
quadrayEntityInt
startFadeDouble
falloffDouble
Returns
Void
Quick Summary
Sets per-entity quad ray fade distance (ray intensity fades based on camera distance from source).
Takes quadrayEntity (quad ray source entity handle), startFade (distance where fade begins in world units), falloff (fade rate, distance from startFade to full fade).
Returns nothing.
Technical Exegesis...
Sets per-entity quad ray fade distance (ray intensity fades based on camera distance from source). Takes quadrayEntity (quad ray source entity handle), startFade (distance where fade begins in world units), falloff (fade rate, distance from startFade to full fade). Returns nothing. Sets entity.quadRayFadeStart and entity.quadRayFadeFalloff (per-entity fade parameters, applied in rendering pipeline).
Sets per-entity quad ray fade distance (ray intensity fades based on camera distance from source). Takes quadrayEntity (quad ray source entity handle), startFade (distance where fade begins in world units), falloff (fade rate, distance from startFade to full fade). Returns nothing. Sets entity.quadRayFadeStart and entity.quadRayFadeFalloff (per-entity fade parameters, applied in rendering pipeline). Use to fade distant quad ray sources (prevent far sources from overwhelming scene), optimize performance (fade out distant sources to reduce tracing work), or create depth effect (near sources prominent, far sources subtle). Fade calculation: distance < startFade = full intensity (no fade, rays at full strength), distance >= startFade = fade (intensity reduces linearly over falloff distance), distance >= startFade + falloff = fully faded (rays invisible, source skipped in rendering). Per-entity setting: each quad ray source has independent fade (customize per light, sun no fade while torches fade), global settings still apply (intensity/decay/samples apply to all sources), combine with radiance (radiance screen brightening independent of fade). Use cases: (1) Torch lights (startFade 20, falloff 10 fade torches at distance but keep sun visible), (2) Performance scaling (fade distant sources to reduce GPU load, fewer sources rendered), (3) Depth cueing (near sources prominent, far sources faded creates depth perception), (4) Artistic control (fade unimportant sources, focus attention on key lights), (5) LOD system (fade quad rays similar to mesh LOD, distant lights simplified). Common patterns: torch fade = startFade 30, falloff 20 linear fade from 30-50 units; sun no fade = startFade 0, falloff 0 always visible; spotlight fade = startFade 50, falloff 30 long-range fade. Typical values: no fade (startFade 0, falloff 0 always visible), short range (startFade 20-40, falloff 10-20 for small lights), medium range (startFade 50-100, falloff 30-50 for standard lights), long range (startFade 150-300, falloff 100-200 for distant sources). Fade formula: fadeFactor = 1.0 - saturate((distance - startFade) / falloff) where saturate clamps 0-1, fadeFactor multiplies ray intensity (1.0 = full, 0.0 = invisible). Performance benefit: faded sources skipped earlier (shader early-outs, less tracing work), many distant sources become cheap (fade to zero, minimal GPU cost), prioritizes near sources (visible sources get full quality). Validation: only affects isQuadRaySource entities (non-quad-ray entities ignored), silent if entity not found (invalid handle no-op), accepts any fade values (0 = no fade, negative undefined use 0). Related: b3dLoadQuadRayMesh creates quad ray source (load mesh, then configure fade distance), b3dSetQuadRayRadianceDistance configures screen brightening (camera-distance-based glow, independent of fade), b3dSetQuadRaysIntensity global intensity (applies to all sources, multiplied with fade factor), b3dPositionEntity positions source (fade calculated from camera to entity.position).