|
66 | 66 | var cameraOrtho, cameraPerspective; |
67 | 67 | var controlsOrtho, controlsPerspective; |
68 | 68 |
|
69 | | - var mesh, materialStandard, materialDepthAuto, materialDepthAutoRGBA, materialDepthLinearClipZ, materialDepthLinearClipZRGBA, materialDepthInvClipZ, materialDepthInvClipZRGBA, materialNormal; |
| 69 | + var mesh, materialStandard, materialDepthLinear, materialDepthRGBA, materialNormal; |
70 | 70 |
|
71 | 71 | var pointLight, ambientLight; |
72 | 72 |
|
|
83 | 83 | function initGui() { |
84 | 84 |
|
85 | 85 | var gui = new dat.GUI(); |
86 | | - gui.add( params, 'material', [ 'standard', 'normal', 'depthAuto', 'depthAutoRGBA', 'depthLinearClipZ', 'depthLinearClipZRGBA', 'depthInvClipZ', 'depthInvClipZRGBA' ] ); |
| 86 | + gui.add( params, 'material', [ 'standard', 'normal', 'depthLinear', 'depthRGBA' ] ); |
87 | 87 | gui.add( params, 'camera', [ 'perspective', 'ortho' ] ); |
88 | 88 |
|
89 | 89 | } |
|
172 | 172 | side: THREE.DoubleSide |
173 | 173 | } ); |
174 | 174 |
|
175 | | - materialDepthAuto = new THREE.MeshDepthMaterial( { |
176 | | - depthFormat: THREE.AutoDepthFormat, |
| 175 | + materialDepthLinear = new THREE.MeshDepthMaterial( { |
177 | 176 | depthPacking: THREE.LinearDepthPacking, |
178 | 177 |
|
179 | 178 | displacementMap: displacementMap, |
|
183 | 182 | side: THREE.DoubleSide |
184 | 183 | } ); |
185 | 184 |
|
186 | | - materialDepthAutoRGBA = new THREE.MeshDepthMaterial( { |
187 | | - depthFormat: THREE.AutoDepthFormat, |
188 | | - depthPacking: THREE.RGBADepthPacking, |
189 | | - |
190 | | - displacementMap: displacementMap, |
191 | | - displacementScale: SCALE, |
192 | | - displacementBias: BIAS, |
193 | | - |
194 | | - side: THREE.DoubleSide |
195 | | - } ); |
196 | | - |
197 | | - materialDepthLinearClipZ = new THREE.MeshDepthMaterial( { |
198 | | - depthFormat: THREE.LinearClipZDepthFormat, |
199 | | - depthPacking: THREE.LinearDepthPacking, |
200 | | - |
201 | | - displacementMap: displacementMap, |
202 | | - displacementScale: SCALE, |
203 | | - displacementBias: BIAS, |
204 | | - |
205 | | - side: THREE.DoubleSide |
206 | | - } ); |
207 | | - |
208 | | - materialDepthLinearClipZRGBA = new THREE.MeshDepthMaterial( { |
209 | | - depthFormat: THREE.LinearClipZDepthFormat, |
210 | | - depthPacking: THREE.RGBADepthPacking, |
211 | | - |
212 | | - displacementMap: displacementMap, |
213 | | - displacementScale: SCALE, |
214 | | - displacementBias: BIAS, |
215 | | - |
216 | | - side: THREE.DoubleSide |
217 | | - } ); |
218 | | - |
219 | | - materialDepthInvClipZ = new THREE.MeshDepthMaterial( { |
220 | | - depthFormat: THREE.InvClipZDepthFormat, |
221 | | - depthPacking: THREE.LinearDepthPacking, |
222 | | - |
223 | | - displacementMap: displacementMap, |
224 | | - displacementScale: SCALE, |
225 | | - displacementBias: BIAS, |
226 | | - |
227 | | - side: THREE.DoubleSide |
228 | | - } ); |
229 | | - |
230 | | - materialDepthInvClipZRGBA = new THREE.MeshDepthMaterial( { |
231 | | - depthFormat: THREE.InvClipZDepthFormat, |
| 185 | + materialDepthRGBA = new THREE.MeshDepthMaterial( { |
232 | 186 | depthPacking: THREE.RGBADepthPacking, |
233 | 187 |
|
234 | 188 | displacementMap: displacementMap, |
|
307 | 261 | var material = mesh.material; |
308 | 262 |
|
309 | 263 | switch ( params.material ) { |
| 264 | + |
310 | 265 | case 'standard': material = materialStandard; break; |
311 | | - case 'depthAuto': material = materialDepthAuto; break; |
312 | | - case 'depthAutoRGBA': material = materialDepthAutoRGBA; break; |
313 | | - case 'depthLinearClipZ': material = materialDepthLinearClipZ; break; |
314 | | - case 'depthLinearClipZRGBA': material = materialDepthLinearClipZRGBA; break; |
315 | | - case 'depthInvClipZ': material = materialDepthInvClipZ; break; |
316 | | - case 'depthInvClipZRGBA': material = materialDepthInvClipZRGBA; break; |
| 266 | + case 'depthLinear': material = materialDepthLinear; break; |
| 267 | + case 'depthRGBA': material = materialDepthRGBA; break; |
317 | 268 | case 'normal': material = materialNormal; break; |
| 269 | + |
318 | 270 | } |
319 | 271 |
|
320 | 272 | mesh.material = material; |
|
324 | 276 | switch ( params.camera ) { |
325 | 277 |
|
326 | 278 | case 'perspective': camera = cameraPerspective; break; |
327 | | - |
328 | 279 | case 'ortho': camera = cameraOrtho; break; |
329 | 280 |
|
330 | 281 | } |
|
0 commit comments