Sets shadow camera distance offset from light for directional lights.
Takes light (light handle from b3dCreateLight), distance (shadow camera offset distance in units).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
lightInt
distanceDouble
Returns
Void
Quick Summary
Sets shadow camera distance offset from light for directional lights.
Takes light (light handle from b3dCreateLight), distance (shadow camera offset distance in units).
Returns nothing.
Technical Exegesis...
Sets shadow camera distance offset from light for directional lights. Takes light (light handle from b3dCreateLight, typically directional light), distance (shadow camera position offset in units along light direction, positive = camera farther from scene, typical 0-100). Returns nothing. Adjusts shadow map camera position for directional lights to optimize shadow coverage.
Sets shadow camera distance offset from light for directional lights. Takes light (light handle from b3dCreateLight, typically directional light), distance (shadow camera position offset in units along light direction, positive = camera farther from scene, typical 0-100). Returns nothing. Adjusts shadow map camera position for directional lights to optimize shadow coverage.
Directional light shadows: directional lights have parallel rays (sun-like), shadow camera positioned at distance along light direction (camera looks back at scene, orthographic projection captures shadow map), distance offsets camera position (farther = covers larger area but lower effective resolution, closer = tighter coverage higher precision). Camera positioning: camera placed at scene center + distance * lightDirection (distance controls how far behind scene camera sits), affects shadow map coverage and precision.
Use cases: (1) Outdoor scenes (increase distance to cover large terrain), (2) Indoor scenes (decrease distance for tight precision), (3) Following player (adjust distance based on player height/position). Typical values: close scenes (distance 20-50), medium scenes (distance 50-100), large outdoor (distance 100-200+).
; Directional sun light with medium offset
sun = b3dCreateLight(1)
b3dLightShadowCameraDistance(sun, 75.0)
; Large outdoor scene (farther offset for coverage)
b3dLightShadowCameraDistance(sun, 150.0)