|
@@ -51,7 +51,6 @@
|
|
|
|
|
|
|
|
|
<script src="js/loaders/BinaryLoader.js"></script>
|
|
|
- <script src="js/shaders/DepthRGBAUnpackedShader.js"></script>
|
|
|
|
|
|
<script src="js/Detector.js"></script>
|
|
|
<script src="js/libs/stats.min.js"></script>
|
|
@@ -73,7 +72,7 @@
|
|
|
var cameraOrtho, cameraPerspective;
|
|
|
var controlsOrtho, controlsPerspective;
|
|
|
|
|
|
- var mesh, materialStandard, materialDepth, materialDepthRGBA, materialDepthRGBAUnpacked, materialNormal;
|
|
|
+ var mesh, materialStandard, materialDepthAuto, materialDepthAutoRGBA, materialDepthLinearClipZ, materialDepthLinearClipZRGBA, materialDepthInvClipZ, materialDepthInvClipZRGBA, materialNormal;
|
|
|
|
|
|
var pointLight, ambientLight;
|
|
|
|
|
@@ -87,7 +86,7 @@
|
|
|
function initGui() {
|
|
|
|
|
|
var gui = new dat.GUI();
|
|
|
- gui.add( params, 'material', [ 'standard', 'normal', 'depth', 'depthRGBA', 'depthRGBAUnpacked' ] );
|
|
|
+ gui.add( params, 'material', [ 'standard', 'normal', 'depthAuto', 'depthAutoRGBA', 'depthLinearClipZ', 'depthLinearClipZRGBA', 'depthInvClipZ', 'depthInvClipZRGBA' ] );
|
|
|
gui.add( params, 'camera', [ 'perspective', 'ortho' ] );
|
|
|
|
|
|
}
|
|
@@ -167,9 +166,30 @@
|
|
|
materialStandard.normalMap = normalMap;
|
|
|
materialStandard.normalScale.set( 1, - 1 );
|
|
|
|
|
|
- materialDepth = new THREE.MeshDepthMaterial();
|
|
|
- materialDepthRGBA = new THREE.ShaderMaterial( THREE.ShaderLib.depthRGBA );
|
|
|
- materialDepthRGBAUnpacked = new THREE.ShaderMaterial( THREE.DepthRGBAUnpackedShader );
|
|
|
+ materialDepthAuto = new THREE.MeshDepthMaterial();
|
|
|
+ materialDepthAuto.depthFormat = THREE.AutoDepthFormat;
|
|
|
+ materialDepthAuto.depthPacking = THREE.LinearDepthPacking;
|
|
|
+
|
|
|
+ materialDepthAutoRGBA = new THREE.MeshDepthMaterial();
|
|
|
+ materialDepthAutoRGBA.depthFormat = THREE.AutoDepthFormat;
|
|
|
+ materialDepthAutoRGBA.depthPacking = THREE.RGBADepthPacking;
|
|
|
+
|
|
|
+ materialDepthLinearClipZ = new THREE.MeshDepthMaterial();
|
|
|
+ materialDepthLinearClipZ.depthFormat = THREE.LinearClipZDepthFormat;
|
|
|
+ materialDepthLinearClipZ.depthPacking = THREE.LinearDepthPacking;
|
|
|
+
|
|
|
+ materialDepthLinearClipZRGBA = new THREE.MeshDepthMaterial();
|
|
|
+ materialDepthLinearClipZRGBA.depthFormat = THREE.LinearClipZDepthFormat;
|
|
|
+ materialDepthLinearClipZRGBA.depthPacking = THREE.RGBADepthPacking;
|
|
|
+
|
|
|
+ materialDepthInvClipZ = new THREE.MeshDepthMaterial();
|
|
|
+ materialDepthInvClipZ.depthFormat = THREE.InvClipZDepthFormat;
|
|
|
+ materialDepthInvClipZ.depthPacking = THREE.LinearDepthPacking;
|
|
|
+
|
|
|
+ materialDepthInvClipZRGBA = new THREE.MeshDepthMaterial();
|
|
|
+ materialDepthInvClipZRGBA.depthFormat = THREE.InvClipZDepthFormat;
|
|
|
+ materialDepthInvClipZRGBA.depthPacking = THREE.RGBADepthPacking;
|
|
|
+
|
|
|
materialNormal = new THREE.MeshNormalMaterial();
|
|
|
|
|
|
//
|
|
@@ -236,9 +256,12 @@
|
|
|
|
|
|
switch ( params.material ) {
|
|
|
case 'standard': material = materialStandard; break;
|
|
|
- case 'depth': material = materialDepth; break;
|
|
|
- case 'depthRGBA': material = materialDepthRGBA; break;
|
|
|
- case 'depthRGBAUnpacked': material = materialDepthRGBAUnpacked; break;
|
|
|
+ case 'depthAuto': material = materialDepthAuto; break;
|
|
|
+ case 'depthAutoRGBA': material = materialDepthAutoRGBA; break;
|
|
|
+ case 'depthLinearClipZ': material = materialDepthLinearClipZ; break;
|
|
|
+ case 'depthLinearClipZRGBA': material = materialDepthLinearClipZRGBA; break;
|
|
|
+ case 'depthInvClipZ': material = materialDepthInvClipZ; break;
|
|
|
+ case 'depthInvClipZRGBA': material = materialDepthInvClipZRGBA; break;
|
|
|
case 'normal': material = materialNormal; break;
|
|
|
}
|
|
|
|