secondlife / viewer

🖥️ Second Life's official client
GNU Lesser General Public License v2.1
212 stars 53 forks source link

Mirror sometimes doesn't reflect the scene even when using current building best practices #1833

Open cosmic-linden opened 5 months ago

cosmic-linden commented 5 months ago

Description

I investigated the two rightmost of three large mirrors at this area in Rumpus Room 2048: secondlife://Aditi/secondlife/Rumpus%20Room%202048/38/154/23 .

The mirror probes appear to be oriented in a similar direction, verified via two methods via debugging:

The "broken" mirror probe shows nothing but void, neither objects nor terrain. The "working" mirror probe shows correct reflections. Due to them having nearly the same orientation, one would expect the behavior to be similar. Something breaks in the math surrounding the hero probe normal. It's either the quaternion math or something a bit later. clipPlane and clipSign have bad values in the shader as a result, causing mirrorClip to discard the reflected objects.

It's currently hard to create a new mirror to attempt to reproduce this bug from scratch, due to current bugs with mirror creation. For this reason, I recommend the SLURL testing location.

This ticket is prior to implementation of https://github.com/secondlife/viewer/issues/1012 .

cosmic-linden commented 5 months ago

Setting priority to high because this is related to (but not equvialent to) Mirror UI/UX: https://github.com/secondlife/viewer/issues/1012