diff options
author | Graham Linden <graham@lindenlab.com> | 2019-09-09 09:08:58 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-09-09 09:08:58 -0700 |
commit | 872d82529f7ca2afc3cbd3d1436c5026105da489 (patch) | |
tree | a09b6a47c771977e7bfa440e04a7a63aafdc9395 /indra/newview | |
parent | 16933b0ab9a8556467fba18790050f2d025d06a5 (diff) |
SL-1144
The un-water-fogged gap area was rendering while we were still above water, but the water surface was being near culled.
I've re-enabled preculling water objects (which also fixes issues with water culling vs spinning the camera) and it seems to behave correctly.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl | 2 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 12 |
2 files changed, 3 insertions, 11 deletions
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl index 4460ef905b..e5f1e11180 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl @@ -121,7 +121,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou temp2.x += .25; temp2.x *= sun_moon_glow_factor; - + vec4 amb_color = ambient_color; //increase ambient when there are more clouds diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8dd7622494..50d6a6909f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2518,18 +2518,12 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl sCull->pushDrawable(gSky.mVOWLSkyp->mDrawable); } -// not currently enabled as it causes reflection/distortion map -// rendering to occur every frame instead of periodically for visible near water -#if PRECULL_WATER_OBJECTS bool render_water = !sReflectionRender && (hasRenderType(LLPipeline::RENDER_TYPE_WATER) || hasRenderType(LLPipeline::RENDER_TYPE_VOIDWATER)); if (render_water) { LLWorld::getInstance()->precullWaterObjects(camera, sCull, render_water); } -#endif - - gGL.matrixMode(LLRender::MM_PROJECTION); gGL.popMatrix(); @@ -9299,7 +9293,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) S32 detail = RenderReflectionDetail; F32 water_height = gAgent.getRegion()->getWaterHeight(); - F32 camera_height = camera_in.getOrigin().mV[2]; + F32 camera_height = camera_in.getOrigin().mV[VZ]; F32 distance_to_water = (water_height < camera_height) ? (camera_height - water_height) : (water_height - camera_height); LLVector3 reflection_offset = LLVector3(0, 0, distance_to_water * 2.0f); @@ -9334,7 +9328,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) glh::matrix4f current = get_current_modelview(); - if (!LLViewerCamera::getInstance()->cameraUnderWater()) + if (!camera_is_underwater) { //generate planar reflection map LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WATER0; @@ -9443,8 +9437,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLPipeline::RENDER_TYPE_GROUND, END_RENDER_TYPES); - bool camera_is_underwater = LLViewerCamera::getInstance()->cameraUnderWater(); - // intentionally inverted so that distortion map contents (objects under the water when we're above it) // will properly include water fog effects LLPipeline::sUnderWaterRender = !camera_is_underwater; |