2
0
Эх сурвалжийг харах

BasicDepthPacking: white nearest

WestLangley 7 жил өмнө
parent
commit
108ea9e2e8

+ 1 - 1
examples/js/postprocessing/SAOPass.js

@@ -238,7 +238,7 @@ THREE.SAOPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ),
 		if ( ! this.supportsDepthTextureExtension ) {
 		if ( ! this.supportsDepthTextureExtension ) {
 
 
 			// Clear rule : far clipping plane in both RGBA and Basic encoding
 			// Clear rule : far clipping plane in both RGBA and Basic encoding
-			this.renderOverride( renderer, this.depthMaterial, this.depthRenderTarget, 0xffffff, 1.0 );
+			this.renderOverride( renderer, this.depthMaterial, this.depthRenderTarget, 0x000000, 1.0 );
 
 
 		}
 		}
 
 

+ 1 - 1
examples/webgl_postprocessing_sao.html

@@ -90,7 +90,7 @@
 				var devicePixelRatio = window.devicePixelRatio || 1;
 				var devicePixelRatio = window.devicePixelRatio || 1;
 
 
 				renderer = new THREE.WebGLRenderer( { antialias: true } );
 				renderer = new THREE.WebGLRenderer( { antialias: true } );
-				renderer.setClearColor( 0xa0a0a0 );
+				renderer.setClearColor( 0x000000 );
 				renderer.setPixelRatio( devicePixelRatio );
 				renderer.setPixelRatio( devicePixelRatio );
 				renderer.setSize( width, height );
 				renderer.setSize( width, height );
 				document.body.appendChild( renderer.domElement );
 				document.body.appendChild( renderer.domElement );

+ 1 - 1
src/renderers/shaders/ShaderLib/depth_frag.glsl

@@ -32,7 +32,7 @@ void main() {
 
 
 	#if DEPTH_PACKING == 3200
 	#if DEPTH_PACKING == 3200
 
 
-		gl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );
+		gl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );
 
 
 	#elif DEPTH_PACKING == 3201
 	#elif DEPTH_PACKING == 3201