@@ -95,21 +95,31 @@ define([
95
95
that . _outlineBatches [ shadows ] . add ( time , updater ) ;
96
96
}
97
97
98
+ var multiplier = 0 ;
99
+ if ( defined ( updater . depthFailMaterialProperty ) ) {
100
+ multiplier = updater . depthFailMaterialProperty instanceof ColorMaterialProperty ? 1 : 2 ;
101
+ }
102
+
103
+ var index ;
104
+ if ( defined ( shadows ) ) {
105
+ index = shadows + multiplier * ShadowMode . NUMBER_OF_SHADOW_MODES ;
106
+ }
107
+
98
108
if ( updater . fillEnabled ) {
99
109
if ( updater . onTerrain ) {
100
110
that . _groundColorBatch . add ( time , updater ) ;
101
111
} else {
102
112
if ( updater . isClosed ) {
103
113
if ( updater . fillMaterialProperty instanceof ColorMaterialProperty ) {
104
- that . _closedColorBatches [ shadows ] . add ( time , updater ) ;
114
+ that . _closedColorBatches [ index ] . add ( time , updater ) ;
105
115
} else {
106
- that . _closedMaterialBatches [ shadows ] . add ( time , updater ) ;
116
+ that . _closedMaterialBatches [ index ] . add ( time , updater ) ;
107
117
}
108
118
} else {
109
119
if ( updater . fillMaterialProperty instanceof ColorMaterialProperty ) {
110
- that . _openColorBatches [ shadows ] . add ( time , updater ) ;
120
+ that . _openColorBatches [ index ] . add ( time , updater ) ;
111
121
} else {
112
- that . _openMaterialBatches [ shadows ] . add ( time , updater ) ;
122
+ that . _openMaterialBatches [ index ] . add ( time , updater ) ;
113
123
}
114
124
}
115
125
}
@@ -152,17 +162,28 @@ define([
152
162
153
163
var numberOfShadowModes = ShadowMode . NUMBER_OF_SHADOW_MODES ;
154
164
this . _outlineBatches = new Array ( numberOfShadowModes ) ;
155
- this . _closedColorBatches = new Array ( numberOfShadowModes ) ;
156
- this . _closedMaterialBatches = new Array ( numberOfShadowModes ) ;
157
- this . _openColorBatches = new Array ( numberOfShadowModes ) ;
158
- this . _openMaterialBatches = new Array ( numberOfShadowModes ) ;
165
+ this . _closedColorBatches = new Array ( numberOfShadowModes * 3 ) ;
166
+ this . _closedMaterialBatches = new Array ( numberOfShadowModes * 3 ) ;
167
+ this . _openColorBatches = new Array ( numberOfShadowModes * 3 ) ;
168
+ this . _openMaterialBatches = new Array ( numberOfShadowModes * 3 ) ;
159
169
160
170
for ( var i = 0 ; i < numberOfShadowModes ; ++ i ) {
161
171
this . _outlineBatches [ i ] = new StaticOutlineGeometryBatch ( primitives , scene , i ) ;
162
- this . _closedColorBatches [ i ] = new StaticGeometryColorBatch ( primitives , type . perInstanceColorAppearanceType , true , i ) ;
163
- this . _closedMaterialBatches [ i ] = new StaticGeometryPerMaterialBatch ( primitives , type . materialAppearanceType , true , i ) ;
164
- this . _openColorBatches [ i ] = new StaticGeometryColorBatch ( primitives , type . perInstanceColorAppearanceType , false , i ) ;
165
- this . _openMaterialBatches [ i ] = new StaticGeometryPerMaterialBatch ( primitives , type . materialAppearanceType , false , i ) ;
172
+
173
+ this . _closedColorBatches [ i ] = new StaticGeometryColorBatch ( primitives , type . perInstanceColorAppearanceType , undefined , true , i ) ;
174
+ this . _closedMaterialBatches [ i ] = new StaticGeometryPerMaterialBatch ( primitives , type . materialAppearanceType , undefined , true , i ) ;
175
+ this . _openColorBatches [ i ] = new StaticGeometryColorBatch ( primitives , type . perInstanceColorAppearanceType , undefined , false , i ) ;
176
+ this . _openMaterialBatches [ i ] = new StaticGeometryPerMaterialBatch ( primitives , type . materialAppearanceType , undefined , false , i ) ;
177
+
178
+ this . _closedColorBatches [ i + numberOfShadowModes ] = new StaticGeometryColorBatch ( primitives , type . perInstanceColorAppearanceType , type . perInstanceColorAppearanceType , true , i ) ;
179
+ this . _closedMaterialBatches [ i + numberOfShadowModes ] = new StaticGeometryPerMaterialBatch ( primitives , type . materialAppearanceType , type . perInstanceColorAppearanceType , true , i ) ;
180
+ this . _openColorBatches [ i + numberOfShadowModes ] = new StaticGeometryColorBatch ( primitives , type . perInstanceColorAppearanceType , type . perInstanceColorAppearanceType , false , i ) ;
181
+ this . _openMaterialBatches [ i + numberOfShadowModes ] = new StaticGeometryPerMaterialBatch ( primitives , type . materialAppearanceType , type . perInstanceColorAppearanceType , false , i ) ;
182
+
183
+ this . _closedColorBatches [ i + numberOfShadowModes * 2 ] = new StaticGeometryColorBatch ( primitives , type . perInstanceColorAppearanceType , type . materialAppearanceType , true , i ) ;
184
+ this . _closedMaterialBatches [ i + numberOfShadowModes * 2 ] = new StaticGeometryPerMaterialBatch ( primitives , type . materialAppearanceType , type . materialAppearanceType , true , i ) ;
185
+ this . _openColorBatches [ i + numberOfShadowModes * 2 ] = new StaticGeometryColorBatch ( primitives , type . perInstanceColorAppearanceType , type . materialAppearanceType , false , i ) ;
186
+ this . _openMaterialBatches [ i + numberOfShadowModes * 2 ] = new StaticGeometryPerMaterialBatch ( primitives , type . materialAppearanceType , type . materialAppearanceType , false , i ) ;
166
187
}
167
188
168
189
this . _groundColorBatch = new StaticGroundGeometryColorBatch ( groundPrimitives ) ;
0 commit comments