Environment API
Lighting, material, sky, fog, effects, and presets.
Environment
set_sun_direction
functionSets the direction of the sun light.
set_sun_direction(x: f64, y: f64, z: f64)set_sun_direction(1.0, 1.0, 0.5)set_sun_color
functionSets the color of the sun light.
set_sun_color(r: f64, g: f64, b: f64)set_sun_color(1.0, 0.9, 0.8)set_sun_intensity
functionSets the sun brightness multiplier.
set_sun_intensity(intensity: f64)set_sun_intensity(1.5)set_ambient_color
functionSets the ambient light color.
set_ambient_color(r: f64, g: f64, b: f64)set_ambient_color(0.1, 0.1, 0.15)set_ambient_intensity
functionSets the ambient light brightness multiplier.
set_ambient_intensity(intensity: f64)set_ambient_intensity(0.8)set_material_color
functionSets the base material color.
set_material_color(r: f64, g: f64, b: f64)set_material_color(0.8, 0.2, 0.1)set_material_color_hex
functionSets the base material color from a hex string.
set_material_color_hex(hex: string)set_material_color_hex("#cc5533")set_material_shininess
functionSets material shininess.
set_material_shininess(shininess: f64)set_material_shininess(16.0)set_specular_intensity
functionSets specular highlight strength.
set_specular_intensity(intensity: f64)set_specular_intensity(0.4)set_sky_horizon
functionSets the sky color near the horizon.
set_sky_horizon(r: f64, g: f64, b: f64)set_sky_horizon(0.7, 0.8, 0.9)set_sky_zenith
functionSets the sky color at the zenith.
set_sky_zenith(r: f64, g: f64, b: f64)set_sky_zenith(0.3, 0.5, 0.8)set_background_color
aliasCompatibility alias that sets both sky horizon and zenith colors.
set_background_color(r: f64, g: f64, b: f64)set_background_color(0.1, 0.1, 0.12)Alias for set_sky_horizon + set_sky_zenith.
set_fog_color
functionSets the fog color.
set_fog_color(r: f64, g: f64, b: f64)set_fog_color(0.6, 0.65, 0.7)set_fog_density
functionSets fog density.
set_fog_density(density: f64)set_fog_density(0.02)set_ao_enabled
functionEnables or disables ambient occlusion.
set_ao_enabled(enabled: bool)set_ao_enabled(true)set_ao_intensity
functionSets ambient occlusion strength.
set_ao_intensity(intensity: f64)set_ao_intensity(1.5)set_shadows_enabled
functionEnables or disables shadows.
set_shadows_enabled(enabled: bool)set_shadows_enabled(true)set_shadow_softness
functionSets shadow softness.
set_shadow_softness(softness: f64)set_shadow_softness(0.2)rgb_hex
functionConverts a hex color string to normalized RGB values.
rgb_hex(hex: string) -> arraylet color = rgb_hex("#ff5500");env_default
aliasResets environment settings to the default.
env_default()env_default()Alias for Environment::default.
env_studio
presetApplies clean studio lighting.
env_studio()env_studio()env_sunset
presetApplies warm sunset lighting.
env_sunset()env_sunset()env_night
presetApplies cool night lighting.
env_night()env_night()env_daylight
presetApplies daylight lighting.
env_daylight()env_daylight()env_clay
presetApplies a clay material studio preset.
env_clay()env_clay()