llSetEnvironment
integer llSetEnvironment(vector position,// Position vector in region coordinates to specify the target parcel, or <-1.0, -1.0, z> for the entire region (where z specifies the sky track, or -1 for all tracks).list params// A list of environmental attributes and values to apply (or empty to clear).
);- Returns
integer- Energy
- 10
This function overrides the environmental settings for a region or a parcel. The owner of the script must have permission to modify the environment on the parcel or be an estate manager to change the entire region.
An override for a given parameter can be set at the region scope or parcel scope. It can also be set for a single sky track, all sky tracks, or both. If an override of a given parameter is specified for both an individual track and all tracks, the individual track’s override takes priority.
Note that the list of valid parameters differs from those available for llGetEnvironment.
integer result = llSetEnvironment(ZERO_VECTOR, []);Specification
Section titled “Specification”// Sun, moon and starsSKY_SUN, rotation rot, float scale, vector sun_colorSKY_MOON, rotation rot, float scale, float brightnessSKY_SUN_TEXTURE, string texture_ident // inventory name or UUIDSKY_MOON_TEXTURE, string texture_ident // inventory name or UUIDSKY_GLOW, float glow_size, float glow_focusSKY_STAR_BRIGHTNESS, float brightness // 0 to 500// Sky colour and atmosphereSKY_AMBIENT, vector colorSKY_BLUE, vector blue_density, vector blue_horizonSKY_HAZE, float density, float horizon, float density_multiplier, float distance_multiplierSKY_GAMMA, float gamma // 0 to 20SKY_DOME, float offset, float radius, float max_altitudeSKY_PLANET, float planet_radius, float sky_bottom_radius, float sky_top_radiusSKY_REFRACTION, float moisture_level, float droplet_radius, float ice_levelSKY_REFLECTION_PROBE_AMBIANCE, float ambiance // 0.0 to 10.0// CloudsSKY_CLOUDS, vector color, float coverage, float scale, float variance, vector scroll, vector density, vector detailSKY_CLOUD_TEXTURE, string texture_ident // inventory name or UUID// WaterWATER_FOG, vector color, float density, float modulationWATER_NORMAL_TEXTURE, string texture_ident // inventory name or UUIDWATER_NORMAL_SCALE, vector scale // <0,0,0> to <10,10,10>WATER_WAVE_DIRECTION, vector large_wave, vector small_waveWATER_FRESNEL, float offset, float scaleWATER_REFRACTION, float scale_above, float scale_belowWATER_BLUR_MULTIPLIER, float multiplier // -0.5 to 0.5
Return Values
| Value | Constant | Description |
|---|---|---|
ENV_OK | 1 | The parcel or region will attempt to change the applied environment. |
ENV_NO_ENVIRONMENT | -3 | There is no environment on this parcel to modify. |
ENV_INVALID_RULE | -5 | There was an issue with one of the rules. |
ENV_VALIDATION_FAIL | -6 | Unable to validate values passed. |
ENV_THROTTLE | -8 | The scripts have exceeded the throttle. Wait and retry the request. |
ENV_NO_PERMISSIONS | -9 | The script does not have rights to modify this parcel or region. |
Parameters
Section titled “Parameters”| parameter | integer value | values to set | description |
|---|---|---|---|
SKY_CLOUDS, vector color, float coverage, float scale, float variance, vector scroll, vector density, vector detail, integer is_default | 2 | vector color, float coverage, float scale, float variance, vector scroll, vector density, vector detail | Environmental cloud information:
|
SKY_CLOUD_TEXTURE | 19 | string texture_ident | Name of item in inventory or UUID for texture to be used for the clouds. |
SKY_DOME, float offset, float radius, float max_altitude | 4 | float offset, float radius, float max_altitude | Sky dome information.
|
SKY_GAMMA | 5 | float gamma | The gamma value applied to the scene. range = [0,20] |
SKY_GLOW, float glow_size, float glow_focus | 6 | float glow_size, float glow_focus | Glow applied to the sun and moon.
|
SKY_MOON, rotation rot, float scale, float brightness, integer is_default_texture, vector direction, vector ambient_color, vector diffuse_color | 9 | rotation rot, float scale, float brightness | Detailed moon information:
|
SKY_MOON_TEXTURE | 20 | string texture_ident | Name of texture in inventory or UUID for texture to be used for the moon. |
SKY_STAR_BRIGHTNESS | 13 | float brightness | Brightness value applied to stars. range = [0,500] |
SKY_SUN, rotation rot, float scale, vector sun_color, integer is_default_texture, vector direction, vector ambient_color, vector diffuse_color | 14 | rotation rot, float scale, vector sun_color | Detailed sun information:
|
SKY_SUN_TEXTURE | 21 | string texture_ident | Name of texture in inventory or UUID for texture to be used for the sun. |
SKY_PLANET, float planet_radius, float sky_bottom_radius, float sky_top_radius | 10 | float planet_radius, float sky_bottom_radius, float sky_top_radius | Planet information used in rendering the sky.
|
SKY_REFRACTION, float moisture_level, float droplet_radius, float ice_level | 11 | float moisture_level, float droplet_radius, float ice_level | Sky refraction parameters for rainbows and optical effects.
|
WATER_BLUR_MULTIPLIER | 100 | float multiplier | Multiplier applied to blur the scene when under water. range = [-0.5, 0.5] |
WATER_FOG, vector color, float density, float modulation | 101 | vector color, float density, fload modulation | Fog parameters applied when underwater:
|
WATER_FRESNEL, float offset, float scale | 102 | float offset, float scale | Fresnel scattering applied to the surface of the water.
scale: range = [0,1] |
WATER_NORMAL_TEXTURE | 107 | string texture_ident | Name of texture in inventory or UUID of texture to be used for the water normal. |
WATER_NORMAL_SCALE | 104 | vector scale | Scaling applied to the water normal map. range = [<0,0,0>, <10,10,10>] |
WATER_REFRACTION, float scale_above, float scale_below | 105 | float scale_above, float scale_below | Refraction factors when looking through the surface of the water.
|
WATER_WAVE_DIRECTION, vector large_wave, vector small_wave | 106 | vector large_wave, vector small_wave | Vector for the directions of the waves Y represents north/south and X represents movement east/west.
|
SKY_AMBIENT | 0 | vector color | Ambient color used in the scene. |
SKY_BLUE, vector blue_density, vector blue_horizon | 22 | vector blue_density, vector blue_horizon | Change the colors used to calculate blue density and blue horizon in the environment. |
SKY_HAZE, float density, float horizon, float density_multiplier, float distance_multiplier | 23 | float density, float horizon, float density_multiplier, float distance_multiplier | Values used to calculate the impact of blue_density and blue_horizon on the scene lighting. |
SKY_REFLECTION_PROBE_AMBIANCE | 24 | float ambiance | Minimum ambiance value for all reflection probes. range = [0.0, 10.0] Caveat: This feature will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer. |
Caveats
Section titled “Caveats”- An environment set locally on the viewer will override any environment set from this function.
- When changing a parcel’s environment it must first have had an environment set.
- If the parcel is group-owned, the script must either be deeded to the group, or the script owner must have “Modify environment settings and day cycle” group ability and have an active agent in the sim.
- The
ENV_OKconstant is only present on Lua-enabled sims. On older sims, use it’s value of 1 instead
History
Section titled “History”Date of Release 12/08/2022
See also
Section titled “See also”Functions
Section titled “Functions”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.