Skip to content

Commit

Permalink
Merge pull request #7451 from AnalyticalGraphicsInc/hdr-toggle
Browse files Browse the repository at this point in the history
Fix OIT when toggling HDR.
  • Loading branch information
lilleyse authored Jan 2, 2019
2 parents 859512f + 9284129 commit db83ba6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,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

Expand Down
8 changes: 6 additions & 2 deletions Source/Scene/OIT.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ define([

this._useScissorTest = false;
this._scissorRectangle = undefined;

this._useHDR = false;
}

function destroyTextures(oit) {
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
}
Expand All @@ -225,6 +227,8 @@ define([
}
}

this._useHDR = useHDR;

var that = this;
var fs;
var uniformMap;
Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit db83ba6

Please sign in to comment.