Unlocks quad ray and triggers baking (freezes occlusion texture for static source, performance optimization). Takes handle (quad ray source entity handle). Returns nothing. Sets entity.quadRayLocked = false (per-entity unlock state, enables baking in next render pass).
Unlocks quad ray and triggers baking (freezes occlusion texture for static source, performance optimization). Takes handle (quad ray source entity handle). Returns nothing. Sets entity.quadRayLocked = false (per-entity unlock state, enables baking in next render pass). Use to finalize quad ray after editing (unlock when properties finalized, trigger baking for static source), optimize performance (baked sources cheaper than dynamic, occlusion texture frozen), or signal static source (unlock indicates source won't change, renderer can optimize). Unlock behavior: sets quadRayLocked = false (entity marked as finalized, baking enabled), next render pass bakes (occlusion texture rendered once, then cached), sets quadRayBaked = true after baking (marks source as optimized, occlusion silhouette frozen), future changes ignored until re-locked (position/rotation/property changes don't update baked texture). Baking process: on next render after unlock (first render pass after quadRayLocked = false), render source to occlusion texture (WHITE silhouette captured, one-time render), freeze occlusion texture (cache silhouette, no more updates), set quadRayBaked = true (mark as optimized, skip future occlusion renders). Use cases: (1) Finalize static sources (unlock sun/moon/static lights after positioning, bake for performance), (2) Optimize many sources (unlock all static sources in scene, reduce occlusion pass cost), (3) Separate static from dynamic (unlock static sources for baking, keep dynamic sources locked), (4) Performance optimization (baked sources much cheaper, frozen occlusion texture skips per-frame render), (5) Complete setup (unlock after b3dLockQuadRay editing phase, signal setup done). Common patterns: finalize = b3dLockQuadRay(source) during setup, adjust properties, b3dUnlockQuadRay(source) when done; optimize scene = For Each source: b3dUnlockQuadRay(source) bake all static sources; static/dynamic = b3dUnlockQuadRay(sun) bake sun, b3dLockQuadRay(flashlight) keep flashlight dynamic. Baked vs dynamic: baked sources (occlusion texture frozen, no per-frame update, very cheap, position/rotation changes ignored), dynamic sources (occlusion updates each frame, per-frame render cost, all changes visible immediately). Performance benefit: baked sources skip occlusion pass (texture cached, no re-render, just read cached silhouette), many baked sources efficient (shared cached texture, minimal GPU cost), typical savings ~0.5-2ms per source (depends on mesh complexity and occlusion resolution). Limitation of baking: baked source changes ignored (position/rotation/scale/properties don't update occlusion silhouette), must re-lock to edit (b3dLockQuadRay re-enables updates, sets quadRayBaked = false, occlusion dynamic again), baking only helps static sources (moving/animated sources must stay locked, baking would freeze incorrect silhouette). When to bake: static sources (sun, fixed lights, never-moving emitters benefit from baking), many sources (scenes with 10+ quad ray sources see significant performance gain), finalized sources (after setup/editing complete, properties won't change). When NOT to bake: dynamic sources (moving lights, animated sources, flashlights must stay locked), changing properties (sources with time-varying fade/radiance/direction stay locked), testing phase (during setup while adjusting parameters keep locked). Typical workflow: create source (b3dLoadQuadRayMesh initially unlocked), lock for editing (b3dLockQuadRay enable changes), adjust (position/rotate/configure properties while seeing results), unlock when done (this function, trigger baking for optimization), source now optimized (baked silhouette, cheap rendering). Validation: only affects isQuadRaySource entities (non-quad-ray entities ignored), silent if entity not found (invalid handle no-op), no error checking (assumes entity exists and is quad ray source). Related: b3dLockQuadRay locks quad ray (opposite of this function, enables editing and disables baking), b3dLoadQuadRayMesh creates quad ray source (initially unlocked, baking happens automatically unless locked), b3dPositionEntity positions source (changes ignored if baked, must lock first to update), b3dRotateEntity rotates source (changes ignored if baked, must lock first to update).