SL-11678 Avatar is reflecting on the under side of water surface

Avatar wasn't reflecting but distorting, since avatar was already under water it looked like a 'reflection' of avatar, but was not rotated right and with wrong angle.
master
Andrey Kleshchev 2021-09-23 22:38:30 +03:00
parent 709184e0ff
commit 819088563e
1 changed files with 1 additions and 7 deletions

View File

@ -9428,19 +9428,13 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
//clip out geometry on the same side of water as the camera w/ enough margin to not include the water geo itself,
// but not so much as to clip out parts of avatars that should be seen under the water in the distortion map
LLPlane plane(-pnorm, water_dist);
LLPlane plane(-pnorm, camera_is_underwater ? -water_height : water_dist);
LLGLUserClipPlane clip_plane(plane, saved_modelview, saved_projection);
gGL.setColorMask(true, true);
mWaterDis.clear();
gGL.setColorMask(true, false);
// ignore clip plane if we're underwater and viewing distortion map of objects above waterline
if (camera_is_underwater)
{
clip_plane.disable();
}
if (reflection_detail >= WATER_REFLECT_NONE_WATER_TRANSPARENT)
{
updateCull(camera, mRefractedObjects, water_clip, &plane);