|
@@ -5,7 +5,6 @@ import {
|
|
DepthTexture,
|
|
DepthTexture,
|
|
SrcAlphaFactor,
|
|
SrcAlphaFactor,
|
|
OneMinusSrcAlphaFactor,
|
|
OneMinusSrcAlphaFactor,
|
|
- LinearFilter,
|
|
|
|
MeshNormalMaterial,
|
|
MeshNormalMaterial,
|
|
MeshBasicMaterial,
|
|
MeshBasicMaterial,
|
|
NearestFilter,
|
|
NearestFilter,
|
|
@@ -43,7 +42,7 @@ class SSRPass extends Pass {
|
|
this.output = 0;
|
|
this.output = 0;
|
|
|
|
|
|
this.maxDistance = SSRShader.uniforms.maxDistance.value;
|
|
this.maxDistance = SSRShader.uniforms.maxDistance.value;
|
|
- this.surfDist = SSRShader.uniforms.surfDist.value;
|
|
|
|
|
|
+ this.thickness = SSRShader.uniforms.thickness.value;
|
|
|
|
|
|
this.encoding = encoding;
|
|
this.encoding = encoding;
|
|
|
|
|
|
@@ -155,7 +154,6 @@ class SSRPass extends Pass {
|
|
|
|
|
|
}
|
|
}
|
|
} );
|
|
} );
|
|
- this.thickTolerance = SSRShader.uniforms.thickTolerance.value;
|
|
|
|
|
|
|
|
// beauty render target with depth buffer
|
|
// beauty render target with depth buffer
|
|
|
|
|
|
@@ -165,8 +163,8 @@ class SSRPass extends Pass {
|
|
depthTexture.magFilter = NearestFilter;
|
|
depthTexture.magFilter = NearestFilter;
|
|
|
|
|
|
this.beautyRenderTarget = new WebGLRenderTarget( this.width, this.height, {
|
|
this.beautyRenderTarget = new WebGLRenderTarget( this.width, this.height, {
|
|
- minFilter: LinearFilter,
|
|
|
|
- magFilter: LinearFilter,
|
|
|
|
|
|
+ minFilter: NearestFilter,
|
|
|
|
+ magFilter: NearestFilter,
|
|
format: RGBAFormat,
|
|
format: RGBAFormat,
|
|
depthTexture: depthTexture,
|
|
depthTexture: depthTexture,
|
|
depthBuffer: true
|
|
depthBuffer: true
|
|
@@ -174,8 +172,8 @@ class SSRPass extends Pass {
|
|
|
|
|
|
//for bouncing
|
|
//for bouncing
|
|
this.prevRenderTarget = new WebGLRenderTarget( this.width, this.height, {
|
|
this.prevRenderTarget = new WebGLRenderTarget( this.width, this.height, {
|
|
- minFilter: LinearFilter,
|
|
|
|
- magFilter: LinearFilter,
|
|
|
|
|
|
+ minFilter: NearestFilter,
|
|
|
|
+ magFilter: NearestFilter,
|
|
format: RGBAFormat,
|
|
format: RGBAFormat,
|
|
} );
|
|
} );
|
|
|
|
|
|
@@ -201,8 +199,8 @@ class SSRPass extends Pass {
|
|
// ssr render target
|
|
// ssr render target
|
|
|
|
|
|
this.ssrRenderTarget = new WebGLRenderTarget( this.width, this.height, {
|
|
this.ssrRenderTarget = new WebGLRenderTarget( this.width, this.height, {
|
|
- minFilter: LinearFilter,
|
|
|
|
- magFilter: LinearFilter,
|
|
|
|
|
|
+ minFilter: NearestFilter,
|
|
|
|
+ magFilter: NearestFilter,
|
|
format: RGBAFormat
|
|
format: RGBAFormat
|
|
} );
|
|
} );
|
|
|
|
|
|
@@ -236,7 +234,7 @@ class SSRPass extends Pass {
|
|
this.ssrMaterial.uniforms[ 'tDepth' ].value = this.beautyRenderTarget.depthTexture;
|
|
this.ssrMaterial.uniforms[ 'tDepth' ].value = this.beautyRenderTarget.depthTexture;
|
|
this.ssrMaterial.uniforms[ 'cameraNear' ].value = this.camera.near;
|
|
this.ssrMaterial.uniforms[ 'cameraNear' ].value = this.camera.near;
|
|
this.ssrMaterial.uniforms[ 'cameraFar' ].value = this.camera.far;
|
|
this.ssrMaterial.uniforms[ 'cameraFar' ].value = this.camera.far;
|
|
- this.ssrMaterial.uniforms[ 'surfDist' ].value = this.surfDist;
|
|
|
|
|
|
+ this.ssrMaterial.uniforms[ 'thickness' ].value = this.thickness;
|
|
this.ssrMaterial.uniforms[ 'resolution' ].value.set( this.width, this.height );
|
|
this.ssrMaterial.uniforms[ 'resolution' ].value.set( this.width, this.height );
|
|
this.ssrMaterial.uniforms[ 'cameraProjectionMatrix' ].value.copy( this.camera.projectionMatrix );
|
|
this.ssrMaterial.uniforms[ 'cameraProjectionMatrix' ].value.copy( this.camera.projectionMatrix );
|
|
this.ssrMaterial.uniforms[ 'cameraInverseProjectionMatrix' ].value.copy( this.camera.projectionMatrixInverse );
|
|
this.ssrMaterial.uniforms[ 'cameraInverseProjectionMatrix' ].value.copy( this.camera.projectionMatrixInverse );
|
|
@@ -391,8 +389,7 @@ class SSRPass extends Pass {
|
|
|
|
|
|
this.ssrMaterial.uniforms[ 'opacity' ].value = this.opacity;
|
|
this.ssrMaterial.uniforms[ 'opacity' ].value = this.opacity;
|
|
this.ssrMaterial.uniforms[ 'maxDistance' ].value = this.maxDistance;
|
|
this.ssrMaterial.uniforms[ 'maxDistance' ].value = this.maxDistance;
|
|
- this.ssrMaterial.uniforms[ 'surfDist' ].value = this.surfDist;
|
|
|
|
- this.ssrMaterial.uniforms[ 'thickTolerance' ].value = this.thickTolerance;
|
|
|
|
|
|
+ this.ssrMaterial.uniforms[ 'thickness' ].value = this.thickness;
|
|
this.renderPass( renderer, this.ssrMaterial, this.ssrRenderTarget );
|
|
this.renderPass( renderer, this.ssrMaterial, this.ssrRenderTarget );
|
|
|
|
|
|
|
|
|