Difference between revisions of "PRIM REFLECTION PROBE"
Line 10: | Line 10: | ||
{{#vardefine:p_flags_desc|PRIM_REFLECTION_PROBE_* flags}} | {{#vardefine:p_flags_desc|PRIM_REFLECTION_PROBE_* flags}} | ||
}} | }} | ||
{{#vardefine: | {{#vardefine:reflection_probe_rows| | ||
!{{!}} {{LSLPT|pstype|type}} Flags | !{{!}} {{LSLPT|pstype|type}} Flags | ||
! title="value" {{!}} V | ! title="value" {{!}} V | ||
Line 43: | Line 43: | ||
{{{!}} class="sortable" {{Prettytable|style=margin-top:0;}} | {{{!}} class="sortable" {{Prettytable|style=margin-top:0;}} | ||
{{!}}- {{Hl2}} | {{!}}- {{Hl2}} | ||
{{#var: | {{#var:reflection_probe_rows}} | ||
{{!}}} | {{!}}} | ||
}} | }} | ||
Line 58: | Line 58: | ||
{{{!}} class="sortable" {{Prettytable|style=margin-top:0;}} | {{{!}} class="sortable" {{Prettytable|style=margin-top:0;}} | ||
{{!}}- {{Hl2}} | {{!}}- {{Hl2}} | ||
{{#var: | {{#var:reflection_probe_rows}} | ||
{{!}}} | {{!}}} | ||
|examples= | |examples= |
Revision as of 13:39, 10 October 2022
Warning! Future feature | |
This function will be supported in the upcoming GLTF Materials project. |
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: integer PRIM_REFLECTION_PROBE = 44;The integer constant PRIM_REFLECTION_PROBE has the value 44
PRIM_REFLECTION_PROBE is used to change the reflection probe configuration of the prim. This allows for author-positioned reflection probes. Reflection probes approximate reflective effects on shiny surfaces, and (optionally) environmental lighting effects from nearby objects. Effects are most accurate when viewed from the position of the reflection probe prim. The size and shape of the reflection probe determines the surface from which surrounding light is imaged for these effects.
llSetPrimitiveParams
[ PRIM_REFLECTION_PROBE, integer enabled, float ambiance, float clip_distance, integer flags ]• integer | enabled | |||
• float | ambiance | – | Ranges from 0.0 to 1.0. Is the brightness of lighting effects from the probe, but not reflection effects. If the environment settings has nonzero reflection probe ambiance, the effective probe ambiance is the greater of the two. | |
• float | clip_distance | – | Ranges from 0.0 to 1024.0. Is the minimum distance from the probe's center where the surroundings are included for imaging. | |
• integer | flags | – | PRIM_REFLECTION_PROBE_* flags |
When used with llSetPrimitiveParams & llSetLinkPrimitiveParams & llSetLinkPrimitiveParamsFast
llGetPrimitiveParams
llGetPrimitiveParams([ PRIM_REFLECTION_PROBE ]);Returns the list [ integer enabled, float ambiance, float clip_distance, integer flags ]
• integer | enabled | |||
• float | ambiance | – | Ranges from 0.0 to 1.0. Is the brightness of lighting effects from the probe, but not reflection effects. If the environment settings has nonzero reflection probe ambiance, the effective probe ambiance is the greater of the two. | |
• float | clip_distance | – | Ranges from 0.0 to 1024.0. Is the minimum distance from the probe's center where the surroundings are included for imaging. | |
• integer | flags | – | PRIM_REFLECTION_PROBE_* flags |
type Flags | V | Description | Notes | ||||
---|---|---|---|---|---|---|---|
PRIM_REFLECTION_PROBE_BOX | 1 | Determines if the reflection probe is a box or a sphere. | Unset by default (probe is a sphere) | ||||
PRIM_REFLECTION_PROBE_DYNAMIC | 3 | Determines if avatars are included by the probe for imaging. | Unset by default (probe does not image avatars). Imaging avatars in probes has a performance cost. |
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.
Related Articles
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]);
}
}