Skip to content

Commit

Permalink
Fix pickTranslucentDepth for ground primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Mar 31, 2020
1 parent 6f4933d commit 32e2953
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions Source/Scene/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand All @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 32e2953

Please sign in to comment.