Skip to content

Commit

Permalink
Incorporate ideas from PR 12058
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeshurun Hembd committed Sep 11, 2024
1 parent 854907b commit 611bcca
Show file tree
Hide file tree
Showing 2 changed files with 214 additions and 125 deletions.
10 changes: 6 additions & 4 deletions packages/engine/Source/Scene/GlobeTranslucencyState.js
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,9 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function (
scene,
passState
) {
const context = scene.context;
const { context } = scene;
const { uniformState } = context;

const globeCommands = frustumCommands.commands[Pass.GLOBE];
const globeCommandsLength = frustumCommands.indices[Pass.GLOBE];
const classificationCommands =
Expand Down Expand Up @@ -1069,7 +1071,7 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function (

this._globeTranslucencyFramebuffer = globeTranslucencyFramebuffer;

const originalGlobeDepthTexture = context.uniformState.globeDepthTexture;
const originalGlobeDepthTexture = uniformState.globeDepthTexture;
const originalFramebuffer = passState.framebuffer;

// Render to internal framebuffer and get the first depth peel
Expand All @@ -1091,7 +1093,7 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function (
context,
passState
);
context.uniformState.globeDepthTexture = packedDepthTexture;
uniformState.globeDepthTexture = packedDepthTexture;
}

// Render classification on translucent faces
Expand All @@ -1104,7 +1106,7 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function (
);

// Unset temporary state
context.uniformState.globeDepthTexture = originalGlobeDepthTexture;
uniformState.globeDepthTexture = originalGlobeDepthTexture;
passState.framebuffer = originalFramebuffer;
};

Expand Down
Loading

0 comments on commit 611bcca

Please sign in to comment.