Sets reflection update frequency (frames=1 updates every frame, frames=2 every other frame, clamped 1-60).
Takes entity (reflective entity handle), frames (update every N frames, clamped 1-60).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
entityInt
framesInt
Returns
Void
Quick Summary
Sets reflection update frequency (frames=1 updates every frame, frames=2 every other frame, clamped 1-60).
Takes entity (reflective entity handle), frames (update every N frames, clamped 1-60).
Returns nothing.
Technical Exegesis...
Sets reflection update frequency (frames=1 updates every frame, frames=2 every other frame, clamped 1-60). Takes entity (reflective entity handle), frames (update every N frames, clamped 1-60). Returns nothing. Validates entity is reflective, clamps frames to 1-60 range, stores in entity.reflectionUpdateRate, resets entity.reflectionFrameCounter to 0. Controls how often reflection texture is re-rendered (performance optimization).
Sets reflection update frequency (frames=1 updates every frame, frames=2 every other frame, clamped 1-60). Takes entity (reflective entity handle), frames (update every N frames, clamped 1-60). Returns nothing. Validates entity is reflective, clamps frames to 1-60 range, stores in entity.reflectionUpdateRate, resets entity.reflectionFrameCounter to 0. Controls how often reflection texture is re-rendered (performance optimization).
This function trades reflection smoothness for performance via temporal update reduction. Update rate: controls reflection rendering frequency, frames=1 (default) renders reflection every frame (smooth but expensive), frames=2 renders every other frame (50% cost reduction, slight lag), frames=N renders every Nth frame. frames parameter: interval in frames between reflection updates, clamped 1-60. Higher values = less frequent updates = better performance but more lag/stutter in reflection. Frame counter: entity.reflectionFrameCounter tracks frames since last update, resets to 0 when set (ensures consistent timing from call point). Use cases: (1) Performance optimization (reduce reflection cost on lower-end hardware), (2) Distance-based LOD (update distant reflections less frequently), (3) Static scenes (reduce rate if scene rarely changes), (4) Graphics quality settings (quality vs performance slider), (5) Frame rate stabilization (reduce cost spikes from reflections). Common pattern: water=b3dCreateReflectiveGrid(...), b3dSetReflectionUpdateRate(water, 2), updates reflection every other frame (halves rendering cost). Performance impact: frames=2 saves ~50% reflection rendering cost, frames=3 saves ~66%, frames=4 saves ~75%. Visual quality: higher rates cause reflection lag (reflected objects move jerkily), acceptable for slow-moving scenes or distant reflections. Typical values: frames=1 for close important reflections (player-facing water), frames=2-3 for medium priority (distant water, background mirrors), frames=5-10 for low priority (far reflections, static scenes). Clamping: minimum 1 (always update, no skipping), maximum 60 (update once per second at 60fps, very infrequent). Static optimization: if reflected scene never changes, set high value (30-60) to update rarely. Dynamic scenes: keep low (1-3) to avoid obvious lag in reflections. Counter reset: resets reflectionFrameCounter to 0 on call, ensures next frame triggers update (consistent behavior from call point). Entity requirement: must be reflective (isReflective=true). Default: newly created reflective grids use frames=1 (update every frame). Storage: stored in entity.reflectionUpdateRate field, checked each frame during reflection pass. Related: b3dSetReflectionQuality reduces texture resolution for performance (spatial quality vs update rate temporal quality), b3dEnableReflection completely disables reflection rendering (more aggressive than reducing rate).