Skip to content
lsl.devlsl.devLSL Dev

PRIM REFLECTION PROBE

Looking for the current API? Open the PRIM_REFLECTION_PROBE reference →

Wiki description

PRIM_REFLECTION_PROBE is used to change the reflection probe configuration of the prim.
A reflection probe is a volume used for image-based lighting (IBL). It takes an image of its surroundings and uses it as the basis for reflection effects (shiny surfaces) and ambiance effects (light bouncing).
Typically, the viewer automatically places reflection probes. Prim-based probes enable artists to provide hints to the render engine to improve the quality of image based lighting. Only objects in the probe's influence volume are affected.
Lighting is most accurate when the edges of a probe volume are near the geometry that appears in reflections. For example, objects inside a room with a box shaped reflection probe that hugs the walls, floor, and ceiling would show accurate reflections and ambient lighting from the walls of the room.

Caveats

  • A viewer must have reflections enabled to see the effects of reflection probes.
  • By default, the viewer auto-places reflection probes with 0.0 ambiance. Environment settings for the region or parcel can be adjusted to increase reflection probe ambiance for these auto-placed probes.
  • Automatically-placed reflection probes do not image avatars. Imaging avatars in probes has a performance cost.

Examples

Increase the prim's reflection probe ambiance when an agent is detected in the sensor range of the prim. Decrease the probe ambiance when an agent is no longer detected.
integer probe_enabled = TRUE;
float probe_no_agent_ambiance = 0.0;
float probe_agent_ambiance = 1.0;
float probe_clip_distance = 0.0;
integer probe_flags = 0;

default
{
    state_entry()
    {
        integer sensor_type = AGENT;
        float sensor_range = 3.0;
        float sensor_rate = 5.0;
        llSensorRepeat("", "", sensor_type, sensor_range, PI, sensor_rate);
    }

    sensor(integer num_detected)
    {
        llSetPrimitiveParams([PRIM_REFLECTION_PROBE, probe_enabled, probe_agent_ambiance, probe_clip_distance, probe_flags]);
    }
    
    no_sensor()
    {
        llSetPrimitiveParams([PRIM_REFLECTION_PROBE, probe_enabled, probe_no_agent_ambiance, probe_clip_distance, probe_flags]);
    }
}

See also: functions

Shared wiki helpers

The original page also injects shared parameter notes, caveats or issue information through these helpers. Their conditional MediaWiki logic is not reproduced here; inspect the preserved helper source for additional material.

Template:LSL PrimitiveParam Categorize

Original shared helper source (conditional wiki logic is not evaluated)
{{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}||{{#vardefine:hidden-text|{{#var:hidden-text}}
{{#ifexist:Template:LSLC{{#var:lang}}|
 {{LSLC{{#var:lang}}|PrimitiveParams}}
 {{LSLC{{#var:lang}}|PrimitiveParams/{{{1}}}}}
 {{LSLC{{#var:lang}}|{{{1}}}}}
|
 {{LSLC|PrimitiveParams{{#var:lang}}}}
 {{LSLC|PrimitiveParams/{{{1}}}{{#var:lang}}}}
 {{LSLC|{{{1}}}{{#var:lang}}}}
}}
}}}}
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.