Marks existing entity as quad ray source or disables it (converts entity to/from quad ray emitter).
Takes entity (entity handle, any type), enabled (1 = enable as quad ray source, 0 = disable).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
entityInt
enabledInt
Returns
Void
Quick Summary
Marks existing entity as quad ray source or disables it (converts entity to/from quad ray emitter).
Takes entity (entity handle, any type), enabled (1 = enable as quad ray source, 0 = disable).
Returns nothing.
Technical Exegesis...
Marks existing entity as quad ray source or disables it (converts entity to/from quad ray emitter). Takes entity (entity handle, any type), enabled (1 = enable as quad ray source, 0 = disable). Returns nothing. Sets entity.isQuadRaySource flag (marks entity for occlusion pass rendering, WHITE if quad ray source, BLACK if not).
Marks existing entity as quad ray source or disables it (converts entity to/from quad ray emitter). Takes entity (entity handle, any type), enabled (1 = enable as quad ray source, 0 = disable). Returns nothing. Sets entity.isQuadRaySource flag (marks entity for occlusion pass rendering, WHITE if quad ray source, BLACK if not). Use to convert existing entities to quad ray sources (add volumetric light to existing meshes without reloading), toggle quad ray emission (enable/disable per entity dynamically), or reuse entities (entity can be quad ray source sometimes, normal mesh other times). Enable behavior: sets isQuadRaySource = true (entity renders WHITE in occlusion pass, BLACK in main scene if showEmitters false), initializes quad ray properties if not set (fadeStart/fadeFalloff/spread/direction/radiance defaults), entity visible in main scene only if showEmitters true (default hidden, only affects occlusion pass). Disable behavior: sets isQuadRaySource = false (entity renders normally in main scene, not in occlusion pass), quad ray properties preserved (fadeStart/direction/etc unchanged, can re-enable later), stops affecting quad rays (no longer contributes to volumetric light effect). Use cases: (1) Convert existing mesh (load mesh with b3dLoadMesh, then b3dSetQuadRaySource enable it as source), (2) Toggle emission (enable quad ray for torch when lit, disable when extinguished), (3) Dynamic sources (enable/disable based on gameplay, activate quad ray when player turns on flashlight), (4) Reuse entities (entity acts as light source when needed, normal mesh otherwise), (5) Performance control (disable distant quad ray sources to save GPU, enable when closer). Common patterns: convert mesh = mesh = b3dLoadMesh("light.glb"): b3dSetQuadRaySource(mesh, 1) convert to quad ray source; toggle = If lit Then b3dSetQuadRaySource(torch, 1) Else b3dSetQuadRaySource(torch, 0) dynamic on/off. Alternative to b3dLoadQuadRayMesh: b3dLoadQuadRayMesh loads mesh AND enables as source (convenience, one call), b3dSetQuadRaySource enables existing entity (flexibility, entity already loaded), use b3dLoadQuadRayMesh for dedicated sources (mesh only used for quad rays), use b3dSetQuadRaySource for dual-purpose entities (entity visible as mesh and/or quad ray source). Entity compatibility: works with any entity type (mesh, light, billboard, terrain, any handle), mesh entities typical (use mesh geometry for occlusion silhouette), light entities possible (light position becomes quad ray origin, but no geometry for silhouette), billboards possible (NOT IMPLEMENTED YET, future feature for point-source quad rays). Validation: silent if entity not found (invalid handle no-op), accepts any entity handle (doesn't check entity type), enabled treated as boolean (non-zero = true, zero = false). Visibility control: quad ray sources hidden in main scene by default (only rendered in occlusion pass), b3dShowQuadRayEmitters toggles visibility (show sources in main scene for debugging), entity.visible flag affected (showEmitters sets visible true/false for all sources). Performance: enabling/disabling instant (flag toggle, no GPU work), enabled sources add to occlusion pass (each source adds draw call in occlusion texture rendering), many sources possible (occlusion pass cheap, post-processing cost shared across all sources). Related: b3dLoadQuadRayMesh loads mesh as quad ray source (alternative, loads and enables in one call), b3dLoadMesh loads mesh (load first, then enable with this function), b3dShowQuadRayEmitters shows/hides sources (toggles visibility of all quad ray source entities in main scene), b3dEnableQuadRays enables quad rays system (required for quad ray sources to affect scene, activates post-processing).