|
@@ -390,10 +390,10 @@ export class Viewer extends ViewerBase{
|
|
|
//add: for 截图时抗锯齿
|
|
|
|
|
|
{
|
|
|
- this.composer = new EffectComposer( this.renderer );
|
|
|
+ /* this.composer = new EffectComposer( this.renderer );
|
|
|
this.ssaaRenderPass = new SSAARenderPass(0x000000, 0);
|
|
|
this.composer.addPass( this.ssaaRenderPass );
|
|
|
-
|
|
|
+ */
|
|
|
//this.ssaaRenderPass.useCopy = true
|
|
|
//this.ssaaRenderPass.renderToScreen = true;
|
|
|
//this.ssaaRenderPass.needsSwap = false
|
|
@@ -402,7 +402,23 @@ export class Viewer extends ViewerBase{
|
|
|
/* let outlinePass = this.outlinePass = new OutlinePass( );
|
|
|
this.ssaaRenderPass.addPass(outlinePass)
|
|
|
*/
|
|
|
+ //ssaa有透明度、发黑的问题所以不用了
|
|
|
+
|
|
|
+ //--------------------------
|
|
|
+
|
|
|
+
|
|
|
+ this.composer = new EffectComposer( this.renderer );
|
|
|
+ this.composer.scaleRatio = 4 //将底图和测量线绘制在一张高倍贴图上,for测量线不模糊
|
|
|
+ this.composer.readTarget = true //把底图和测量线一起fxaa
|
|
|
+ /* const renderPass = new RenderPass();
|
|
|
|
|
|
+ //renderPass.clearColor = new THREE.Color( 0,0,0 );
|
|
|
+ //renderPass.clearAlpha = 0;
|
|
|
+ renderPass.clear = !this.composer.readTarget
|
|
|
+ this.composer.addPass( renderPass );
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
//for 融合页面
|
|
|
let outlinePass = this.outlinePass = new OutlinePass( );
|
|
|
outlinePass.renderToScreen = true //这样更流畅,不用ssaa了,缺点是outline有锯齿
|
|
@@ -411,25 +427,22 @@ export class Viewer extends ViewerBase{
|
|
|
outlinePass.edgeStrength = 4
|
|
|
outlinePass.edgeGlow = 0
|
|
|
outlinePass.visibleEdgeColor = new THREE.Color("#09a1b3")
|
|
|
- //--------------------------
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- /* this.composer2 = new EffectComposer( this.renderer );
|
|
|
- //const renderPass = new RenderPass();
|
|
|
- //renderPass.clearColor = new THREE.Color( 0, 0, 0 );
|
|
|
- //renderPass.clearAlpha = 0;
|
|
|
- //this.composer2.addPass( renderPass );
|
|
|
- this.fxaaPass = new ShaderPass( FXAAShader );
|
|
|
+ this.fxaaPass = new ShaderPass( FXAAShader );
|
|
|
this.fxaaPass.readTarget = true //add
|
|
|
this.fxaaPass.setSize = function(width, height){
|
|
|
- this.material.uniforms[ 'resolution' ].value.x = 1 / ( width );
|
|
|
- this.material.uniforms[ 'resolution' ].value.y = 1 / ( height );
|
|
|
+ this.material.uniforms[ 'resolution' ].value.x = 1 / ( width ) ;
|
|
|
+ this.material.uniforms[ 'resolution' ].value.y = 1 / ( height ) ;
|
|
|
}
|
|
|
this.fxaaPass.renderToScreen = true;
|
|
|
|
|
|
- this.composer2.addPass( this.fxaaPass );
|
|
|
- this.composer2.readTarget = true
|
|
|
- */
|
|
|
+ this.composer.addPass( this.fxaaPass );
|
|
|
+ //抗锯齿截图 效果时而好时而不好,文字比较模糊
|
|
|
+
|
|
|
+
|
|
|
+ //这两个暂时不能一起用。目前刚好不需要一起用
|
|
|
|
|
|
}
|
|
|
|
|
@@ -3170,15 +3183,19 @@ export class Viewer extends ViewerBase{
|
|
|
})
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
- /* if(params_.screenshot){ //抗锯齿
|
|
|
- params_.target.viewport.set(0, 0, params_.target.width, params_.target.height);
|
|
|
+ if(params_.screenshot){ //抗锯齿
|
|
|
+ /* params_.target.viewport.set(0, 0, params_.target.width, params_.target.height);
|
|
|
//scissorTest && params_.target.scissor.set(left, bottom, width, height);
|
|
|
params_.target.scissorTest = false
|
|
|
this.renderer.setRenderTarget(params_.target)
|
|
|
this.composer.render();
|
|
|
- this.renderer.setRenderTarget(params_.target) //本想再画一层标签,但是viewport总是出错
|
|
|
- } */
|
|
|
+ this.renderer.setRenderTarget(params_.target) //本想再画一层标签,但是viewport总是出错 */
|
|
|
+
|
|
|
+ this.composer.render();
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
this.renderer.setRenderTarget(null)
|