Sets global ambient light color (0-255 RGB, constant illumination on all surfaces).
Takes r/g/b (red/green/blue 0-255).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
rInt
gInt
bInt
Returns
Void
Quick Summary
Sets global ambient light color (0-255 RGB, constant illumination on all surfaces).
Takes r/g/b (red/green/blue 0-255).
Returns nothing.
Technical Exegesis...
Sets global ambient light color (0-255 RGB, constant illumination on all surfaces). Takes r/g/b (red/green/blue 0-255). Returns nothing. Converts RGB from 0-255 to 0.0-1.0 floats, sets global g_ambientLight=(r/255, g/255, b/255). Provides base illumination independent of light sources.
This function sets ambient lighting.
Sets global ambient light color (0-255 RGB, constant illumination on all surfaces). Takes r/g/b (red/green/blue 0-255). Returns nothing. Converts RGB from 0-255 to 0.0-1.0 floats, sets global g_ambientLight=(r/255, g/255, b/255). Provides base illumination independent of light sources.
This function sets ambient lighting. Ambient light: constant illumination added to all surfaces regardless of position/orientation/lights (no directionality, no attenuation, uniform everywhere), prevents completely black shadows (fills in areas not reached by direct lights). Color conversion: RGB values 0-255 converted to 0.0-1.0 floats (standard shader format). Ambient application: finalColor = (directLighting + ambientLight) * surfaceColor, ambient added before surface color multiplication, provides minimum brightness floor. Use cases: (1) Outdoor scenes (50,50,50 gray for sky light, prevents pitch black shadows), (2) Indoor scenes (20,20,20 dim gray for subtle fill), (3) Stylized lighting (bright ambient for cartoon look, dark ambient for dramatic mood), (4) Night scenes (5,5,10 very dark with blue tint), (5) Performance (higher ambient reduces need for fill lights). Common patterns: outdoor day b3dAmbientLight(80,80,80), indoor b3dAmbientLight(30,30,30), night b3dAmbientLight(5,5,10), bright cartoon b3dAmbientLight(150,150,150), dark horror b3dAmbientLight(10,10,10). Typical usage: set once during scene setup, adjust for time-of-day (bright day, dim night), adjust for mood (bright happy, dark scary). Ambient vs lights: ambient is global constant (same everywhere), lights are local with position/direction/attenuation (vary spatially), combine both for realistic lighting (lights for highlights, ambient for fill). Color tinting: colored ambient tints entire scene (blue ambient = cool atmosphere, orange ambient = warm sunset), use neutral gray for realistic outdoor (simulates sky dome), use tinted for stylized looks. Default ambient: likely black (0,0,0) if not set (verify during testing, completely black without ambient or lights). Performance: ambient has minimal cost (simple constant added in shader, no per-light calculations), cheaper than adding fill lights. Global state: g_ambientLight is single global variable (affects all rendering, not per-camera or per-object). Related: b3dLightColor sets individual light colors (different from global ambient), b3dCreateLight creates local lights (different from global ambient), b3dLightIntensity controls light brightness (ambient has no intensity parameter, use RGB values for brightness).