Skip to content

Commit a7e34c1

Browse files
committed
Merge remote-tracking branch 'agi/3d-tiles' into skip-levels
2 parents 8b45f77 + 77d5f14 commit a7e34c1

File tree

9 files changed

+32
-14
lines changed

9 files changed

+32
-14
lines changed

Source/Renderer/Pass.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ define([
2121
ENVIRONMENT : 0,
2222
COMPUTE : 1,
2323
GLOBE : 2,
24-
GROUND : 3,
25-
OPAQUE : 4,
26-
TRANSLUCENT : 5,
27-
OVERLAY : 6,
28-
NUMBER_OF_PASSES : 7
24+
CESIUM_3D_TILE : 3,
25+
GROUND : 4,
26+
OPAQUE : 5,
27+
TRANSLUCENT : 6,
28+
OVERLAY : 7,
29+
NUMBER_OF_PASSES : 8
2930
};
3031

3132
return freezeObject(Pass);

Source/Scene/Cesium3DTileBatchTable.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,7 @@ define([
13401340

13411341
function deriveCommand(command) {
13421342
var derivedCommand = DrawCommand.shallowClone(command);
1343+
derivedCommand.pass = Pass.CESIUM_3D_TILE;
13431344

13441345
// Add a uniform to indicate if the original command was translucent so
13451346
// the shader knows not to cull vertices that were originally transparent

Source/Scene/PointCloud3DTileContent.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ define([
797797
shaderProgram : undefined, // Updated in createShaders
798798
uniformMap : drawUniformMap,
799799
renderState : isTranslucent ? content._translucentRenderState : content._opaqueRenderState,
800-
pass : isTranslucent ? Pass.TRANSLUCENT : Pass.OPAQUE,
800+
pass : isTranslucent ? Pass.TRANSLUCENT : Pass.CESIUM_3D_TILE,
801801
owner : content
802802
});
803803

@@ -811,7 +811,7 @@ define([
811811
shaderProgram : undefined, // Updated in createShaders
812812
uniformMap : pickUniformMap,
813813
renderState : isTranslucent ? content._translucentRenderState : content._opaqueRenderState,
814-
pass : isTranslucent ? Pass.TRANSLUCENT : Pass.OPAQUE,
814+
pass : isTranslucent ? Pass.TRANSLUCENT : Pass.CESIUM_3D_TILE,
815815
owner : content
816816
});
817817
}
@@ -1259,7 +1259,7 @@ define([
12591259
// Update the render state
12601260
var isTranslucent = (this._highlightColor.alpha < 1.0) || (this._constantColor.alpha < 1.0) || this._styleTranslucent;
12611261
this._drawCommand.renderState = isTranslucent ? this._translucentRenderState : this._opaqueRenderState;
1262-
this._drawCommand.pass = isTranslucent ? Pass.TRANSLUCENT : Pass.OPAQUE;
1262+
this._drawCommand.pass = isTranslucent ? Pass.TRANSLUCENT : Pass.CESIUM_3D_TILE;
12631263

12641264
if (defined(this.batchTable)) {
12651265
this.batchTable.update(tileset, frameState);

Source/Scene/Scene.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ define([
13451345
break;
13461346
}
13471347

1348-
var pass = command instanceof ClearCommand ? Pass.OPAQUE : command.pass;
1348+
var pass = command.pass;
13491349
var index = frustumCommands.indices[pass]++;
13501350
frustumCommands.commands[pass][index] = command;
13511351

@@ -1928,6 +1928,13 @@ define([
19281928
}
19291929
}
19301930

1931+
us.updatePass(Pass.CESIUM_3D_TILE);
1932+
commands = frustumCommands.commands[Pass.CESIUM_3D_TILE];
1933+
length = frustumCommands.indices[Pass.CESIUM_3D_TILE];
1934+
for (j = 0; j < length; ++j) {
1935+
executeCommand(commands[j], scene, context, passState);
1936+
}
1937+
19311938
// Execute commands in order by pass up to the translucent pass.
19321939
// Translucent geometry needs special handling (sorting/OIT).
19331940
var startPass = Pass.GROUND + 1;
@@ -2001,7 +2008,7 @@ define([
20012008
var command = commandList[i];
20022009
updateDerivedCommands(scene, command);
20032010

2004-
if (command.castShadows && (command.pass === Pass.GLOBE || command.pass === Pass.OPAQUE || command.pass === Pass.TRANSLUCENT)) {
2011+
if (command.castShadows && (command.pass === Pass.GLOBE || command.pass === Pass.CESIUM_3D_TILE || command.pass === Pass.OPAQUE || command.pass === Pass.TRANSLUCENT)) {
20052012
if (isVisible(command, shadowVolume)) {
20062013
if (isPointLight) {
20072014
for (var k = 0; k < numberOfPasses; ++k) {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
3+
*
4+
* @name czm_passCesium3DTile
5+
* @glslConstant
6+
*
7+
* @see czm_pass
8+
*/
9+
const float czm_passCesium3DTile = 3.0;

Source/Shaders/Builtin/Constants/passGround.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
*
77
* @see czm_pass
88
*/
9-
const float czm_passGround = 3.0;
9+
const float czm_passGround = 4.0;

Source/Shaders/Builtin/Constants/passOpaque.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
*
77
* @see czm_pass
88
*/
9-
const float czm_passOpaque = 4.0;
9+
const float czm_passOpaque = 5.0;

Source/Shaders/Builtin/Constants/passOverlay.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
*
77
* @see czm_pass
88
*/
9-
const float czm_passOverlay = 6.0;
9+
const float czm_passOverlay = 7.0;

Source/Shaders/Builtin/Constants/passTranslucent.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
*
77
* @see czm_pass
88
*/
9-
const float czm_passTranslucent = 5.0;
9+
const float czm_passTranslucent = 6.0;

0 commit comments

Comments
 (0)