Skip to content

Commit db83ba6

Browse files
authored
Merge pull request #7451 from AnalyticalGraphicsInc/hdr-toggle
Fix OIT when toggling HDR.
2 parents 859512f + 9284129 commit db83ba6

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Change Log
1515
* Fixed 3D Tiles visibility checking when running multiple passes within the same frame. [#7289](https://github.com/AnalyticalGraphicsInc/cesium/pull/7289)
1616
* Fixed contrast on imagery layers. [#7382](https://github.com/AnalyticalGraphicsInc/cesium/issues/7382)
1717
* Fixed rendering transparent background color when `highDynamicRange` is enabled. [#7427](https://github.com/AnalyticalGraphicsInc/cesium/issues/7427)
18+
* Fixed translucent geometry when `highDynamicRange` is toggled. [#7451](https://github.com/AnalyticalGraphicsInc/cesium/pull/7451)
1819

1920
### 1.52 - 2018-12-03
2021

Source/Scene/OIT.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ define([
8989

9090
this._useScissorTest = false;
9191
this._scissorRectangle = undefined;
92+
93+
this._useHDR = false;
9294
}
9395

9496
function destroyTextures(oit) {
@@ -200,7 +202,7 @@ define([
200202
return supported;
201203
}
202204

203-
OIT.prototype.update = function(context, passState, framebuffer) {
205+
OIT.prototype.update = function(context, passState, framebuffer, useHDR) {
204206
if (!this.isSupported()) {
205207
return;
206208
}
@@ -213,7 +215,7 @@ define([
213215
var height = this._opaqueTexture.height;
214216

215217
var accumulationTexture = this._accumulationTexture;
216-
var textureChanged = !defined(accumulationTexture) || accumulationTexture.width !== width || accumulationTexture.height !== height;
218+
var textureChanged = !defined(accumulationTexture) || accumulationTexture.width !== width || accumulationTexture.height !== height || useHDR !== this._useHDR;
217219
if (textureChanged) {
218220
updateTextures(this, context, width, height);
219221
}
@@ -225,6 +227,8 @@ define([
225227
}
226228
}
227229

230+
this._useHDR = useHDR;
231+
228232
var that = this;
229233
var fs;
230234
var uniformMap;

Source/Scene/Scene.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,7 @@ define([
29872987
var oit = view.oit;
29882988
var useOIT = environmentState.useOIT = !picking && defined(oit) && oit.isSupported();
29892989
if (useOIT) {
2990-
oit.update(context, passState, view.globeDepth.framebuffer);
2990+
oit.update(context, passState, view.globeDepth.framebuffer, scene._hdr);
29912991
oit.clear(context, passState, clearColor);
29922992
environmentState.useOIT = oit.isSupported();
29932993
}

0 commit comments

Comments
 (0)