Sets reflection texture resolution (quality vs performance tradeoff, clamped to 4096x4096 max).
Takes entity (reflective entity handle), width, height (texture dimensions in pixels).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
entityInt
widthInt
heightInt
Returns
Void
Quick Summary
Sets reflection texture resolution (quality vs performance tradeoff, clamped to 4096x4096 max).
Takes entity (reflective entity handle), width, height (texture dimensions in pixels).
Returns nothing.
Technical Exegesis...
Sets reflection texture resolution (quality vs performance tradeoff, clamped to 4096x4096 max). Takes entity (reflective entity handle), width, height (texture dimensions in pixels). Returns nothing. Validates entity is reflective and dimensions positive, clamps to max 4096x4096, stores new dimensions in entity.reflectionTextureWidth/Height, sets reflectionNeedsRecreation flag for safe recreation at next reflection pass, updates reflection camera viewport to match new texture size.
Sets reflection texture resolution (quality vs performance tradeoff, clamped to 4096x4096 max). Takes entity (reflective entity handle), width, height (texture dimensions in pixels). Returns nothing. Validates entity is reflective and dimensions positive, clamps to max 4096x4096, stores new dimensions in entity.reflectionTextureWidth/Height, sets reflectionNeedsRecreation flag for safe recreation at next reflection pass, updates reflection camera viewport to match new texture size. Higher resolution = sharper reflections but more GPU memory and rendering cost.
This function controls reflection sharpness and performance. Texture resolution: reflection camera renders to texture of specified width x height, this texture mapped onto reflective surface. Quality tradeoff: higher resolution (1024x1024, 2048x2048) = sharper reflections but slower rendering and more VRAM usage, lower resolution (256x256, 512x512) = blurrier reflections but better performance. Clamping: width/height clamped to 4096 max (hardware limits, excessive memory), negative/zero rejected. Deferred recreation: sets reflectionNeedsRecreation flag instead of immediate recreation (GPU resources may still be in use), texture recreated at safe point (beginning of next reflection rendering pass). Camera viewport update: updates reflection camera viewport to match new texture dimensions (maintains correct aspect ratio for reflection capture). Use cases: (1) Performance scaling (reduce resolution on lower-end hardware), (2) Quality settings (graphics options menu), (3) Distance-based LOD (lower resolution for distant reflections), (4) Dynamic quality adjustment (reduce resolution during fast movement). Common pattern: water=b3dCreateReflectiveGrid(...), b3dSetReflectionQuality(water, 512, 512), sets moderate 512x512 resolution for performance. Default resolution: b3dCreateReflectiveGrid uses 1024x1024 by default. Typical resolutions: low quality=256x256 or 512x512, medium=1024x1024 (default), high=2048x2048, ultra=4096x4096 (very expensive). Square textures recommended: use same width/height for uniform quality (512x512, 1024x1024, etc.), non-square possible but may cause aspect ratio issues. GPU memory: texture size in bytes approximately = width * height * 4 bytes (RGBA), plus mipmaps if enabled. Example: 1024x1024 = 4MB, 2048x2048 = 16MB, 4096x4096 = 64MB. Performance impact: rendering cost scales with pixel count (2048x2048 = 4x slower than 1024x1024), multiple reflective surfaces multiply cost. Entity requirement: must be reflective entity (isReflective=true), must have reflection camera (reflectionCameraHandle > 0). Viewport matching: camera viewport set to match texture dimensions for 1:1 pixel correspondence (prevents stretching/squashing). Safe recreation: delayed recreation prevents GPU crashes from releasing in-use resources. Related: b3dCreateReflectiveGrid creates reflective surface with 1024x1024 default, b3dSetReflectionUpdateRate controls update frequency for additional performance control.