diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 5919f63bbb9c..4557d8e2097f 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -2308,15 +2308,17 @@ import GlobeTranslucency from './GlobeTranslucency.js'; } // Draw terrain classification - us.updatePass(Pass.TERRAIN_CLASSIFICATION); - commands = frustumCommands.commands[Pass.TERRAIN_CLASSIFICATION]; - length = frustumCommands.indices[Pass.TERRAIN_CLASSIFICATION]; + if (!environmentState.renderTranslucentDepthForPick) { + us.updatePass(Pass.TERRAIN_CLASSIFICATION); + commands = frustumCommands.commands[Pass.TERRAIN_CLASSIFICATION]; + length = frustumCommands.indices[Pass.TERRAIN_CLASSIFICATION]; - if (globeTranslucent) { - globeTranslucency.executeGlobeClassificationCommands(frustumCommands, scene._cameraUnderground, scene._globe, executeCommand, scene, context, passState); - } else { - for (j = 0; j < length; ++j) { - executeCommand(commands[j], scene, context, passState); + if (globeTranslucent) { + globeTranslucency.executeGlobeClassificationCommands(frustumCommands, scene._cameraUnderground, scene._globe, executeCommand, scene, context, passState); + } else { + for (j = 0; j < length; ++j) { + executeCommand(commands[j], scene, context, passState); + } } } @@ -2332,7 +2334,7 @@ import GlobeTranslucency from './GlobeTranslucency.js'; passState.framebuffer = globeDepth.primitiveFramebuffer; } - if (!environmentState.useInvertClassification || picking) { + if (!environmentState.useInvertClassification || picking || environmentState.renderTranslucentDepthForPick) { // Common/fastest path. Draw 3D Tiles and classification normally. // Draw 3D Tiles @@ -2349,11 +2351,13 @@ import GlobeTranslucency from './GlobeTranslucency.js'; } // Draw classifications. Modifies 3D Tiles color. - us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION); - commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION]; - length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION]; - for (j = 0; j < length; ++j) { - executeCommand(commands[j], scene, context, passState); + if (!environmentState.renderTranslucentDepthForPick) { + us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION); + commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION]; + length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION]; + for (j = 0; j < length; ++j) { + executeCommand(commands[j], scene, context, passState); + } } } } else {