From 3c1e654e7a43c7ae7753b0b34a64e9f5eabc33ad Mon Sep 17 00:00:00 2001 From: Dan Bagnell Date: Wed, 2 Jan 2019 14:09:14 -0500 Subject: [PATCH 1/2] Fix OIT when toggling HDR. --- Source/Scene/OIT.js | 8 ++++++-- Source/Scene/Scene.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Scene/OIT.js b/Source/Scene/OIT.js index 025c8b042607..f029e13a8ad4 100644 --- a/Source/Scene/OIT.js +++ b/Source/Scene/OIT.js @@ -89,6 +89,8 @@ define([ this._useScissorTest = false; this._scissorRectangle = undefined; + + this._useHDR = false; } function destroyTextures(oit) { @@ -200,7 +202,7 @@ define([ return supported; } - OIT.prototype.update = function(context, passState, framebuffer) { + OIT.prototype.update = function(context, passState, framebuffer, useHDR) { if (!this.isSupported()) { return; } @@ -213,7 +215,7 @@ define([ var height = this._opaqueTexture.height; var accumulationTexture = this._accumulationTexture; - var textureChanged = !defined(accumulationTexture) || accumulationTexture.width !== width || accumulationTexture.height !== height; + var textureChanged = !defined(accumulationTexture) || accumulationTexture.width !== width || accumulationTexture.height !== height || useHDR !== this._useHDR; if (textureChanged) { updateTextures(this, context, width, height); } @@ -225,6 +227,8 @@ define([ } } + this._useHDR = useHDR; + var that = this; var fs; var uniformMap; diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index a5c09a86c60a..e3256d11da40 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -2987,7 +2987,7 @@ define([ var oit = view.oit; var useOIT = environmentState.useOIT = !picking && defined(oit) && oit.isSupported(); if (useOIT) { - oit.update(context, passState, view.globeDepth.framebuffer); + oit.update(context, passState, view.globeDepth.framebuffer, scene._hdr); oit.clear(context, passState, clearColor); environmentState.useOIT = oit.isSupported(); } From 92841297bc958b04810ec998845a78a1db09b807 Mon Sep 17 00:00:00 2001 From: Dan Bagnell Date: Wed, 2 Jan 2019 14:12:44 -0500 Subject: [PATCH 2/2] Update CHANGES.md. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 29432abab124..2fe3a7d31be8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ Change Log * Fixed 3D Tiles visibility checking when running multiple passes within the same frame. [#7289](https://github.com/AnalyticalGraphicsInc/cesium/pull/7289) * Fixed contrast on imagery layers. [#7382](https://github.com/AnalyticalGraphicsInc/cesium/issues/7382) * Fixed rendering transparent background color when `highDynamicRange` is enabled. [#7427](https://github.com/AnalyticalGraphicsInc/cesium/issues/7427) +* Fixed translucent geometry when `highDynamicRange` is toggled. [#7451](https://github.com/AnalyticalGraphicsInc/cesium/pull/7451) ### 1.52 - 2018-12-03