Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OIT when toggling HDR. #7451

Merged
merged 2 commits into from
Jan 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

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