PRIM_NORMAL & PRIM_SPECULAR offsets <0 & >1 are truncated to 0 and 1, respectively
Arduenn Schwartzman
llSetlinkPrimitiveParamsFast PRIM_NORMAL & PRIM_SPECULAR offset values <0 & >1 are 'truncated' to 0 and 1, respectively, in contrast to PRIM_TEXTURE offset values, which remain unchanged.
Log In
Maestro Linden
Moving to feature requests. Per https://wiki.secondlife.com/wiki/PRIM_NORMAL and https://wiki.secondlife.com/wiki/PRIM_SPECULAR , it is the expected for offsets to be clamped to [0,1]:
> vector offsets – x and y range from 0.0 to 1.0, in 0.0001 increments. (z is ignored)
> offsets and rotation_in_radians are limited to positive values only, unlike PRIM_TEXTURE and GLTF Overrides. To convert a negative offset to positive, add 1, and to convert a negative rotation to positive, add TWO_PI.
I do see that negative offset values can be set via the build tool, so it would be possible to change the LSL behavior to removing the clamping, though this might break existing scripts that rely on the current behavior.
Arduenn Schwartzman
You can see when you run this script in a prim cube:
default{
state_entry(){
llSetLinkPrimitiveParamsFast(LINK_THIS,[
PRIM_TEXTURE,
ALL_SIDES,TEXTURE_DEFAULT,
<1,1,0>,<-.5,0,0>,0, // Offset.x shows -.50000 in Edit window
PRIM_NORMAL,
ALL_SIDES,TEXTURE_DEFAULT,
<1,1,0>,<-.5,0,0>,0 // Offset.x shows 0.00000 in Edit window
]);
}
}