Sets camera fog distance range (near=clear, far=full fog).
Takes camera (camera entity handle), fogNear (distance fog starts), fogFar (distance fog completes).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
cameraInt
fogNearDouble
fogFarDouble
Returns
Void
Quick Summary
Sets camera fog distance range (near=clear, far=full fog).
Takes camera (camera entity handle), fogNear (distance fog starts), fogFar (distance fog completes).
Returns nothing.
Technical Exegesis...
Sets camera fog distance range (near=clear, far=full fog). Takes camera (camera entity handle), fogNear (distance fog starts), fogFar (distance fog completes). Returns nothing. Validates entity is camera type, allocates camera->Camera3D if null, sets camera->fogNear=(float)fogNear and camera->fogFar=(float)fogFar. Controls fog fade-in distance.
This function sets fog range.
Sets camera fog distance range (near=clear, far=full fog). Takes camera (camera entity handle), fogNear (distance fog starts), fogFar (distance fog completes). Returns nothing. Validates entity is camera type, allocates camera->Camera3D if null, sets camera->fogNear=(float)fogNear and camera->fogFar=(float)fogFar. Controls fog fade-in distance.
This function sets fog range. Fog near: distance from camera where fog begins (objects closer than fogNear have no fog, fully visible), typically inside visible range (fogNear > camera nearPlane). Fog far: distance from camera where fog reaches maximum (objects at fogFar distance fully fog color, maximum opacity), typically at or before far clip plane (fogFar <= camera farPlane for seamless horizon). Linear interpolation: fog factor = (distance - fogNear) / (fogFar - fogNear), clamped to 0.0-1.0, finalColor = lerp(objectColor, fogColor, fogFactor). Use cases: (1) Atmospheric depth (subtle fog for realism), (2) Hide far plane (fog hides abrupt clipping at farPlane), (3) Dense fog (small range for thick fog), (4) Light haze (large range for subtle effect), (5) Dynamic weather (adjust fog range for changing conditions). Common patterns: light haze b3dCameraFogRange(camera, 500, 2000), dense fog b3dCameraFogRange(camera, 10, 50), hide far plane b3dCameraFogRange(camera, farPlane*0.8, farPlane). Typical ranges: outdoor (near=100-500, far=1000-5000), indoor (near=10-50, far=100-500), dense (near=5-20, far=30-100). Fog only applies if fog mode enabled (b3dCameraFogMode mode=1). Camera allocation: if camera->camera==nullptr, allocates new Camera3D. Related: b3dCameraFogMode enables fog, b3dCameraFogColor sets fog color, b3dCameraRange sets near/far clip planes.