|
@@ -52,11 +52,11 @@ import {Loader3DTiles} from '../../../libs/three.js/3dtiles/three-loader-3dtiles
|
|
|
import {PLYLoader} from "../../../libs/three.js/loaders/PLYLoader.js";
|
|
|
|
|
|
|
|
|
-import SSAARenderPass from "../materials/postprocessing/SSAARenderPass.js"
|
|
|
+import SMAAPass from "../materials/postprocessing/SMAAPass.js"
|
|
|
import EffectComposer from '../materials/postprocessing/EffectComposer.js'
|
|
|
import {ShaderPass} from '../materials/postprocessing/ShaderPass.js'
|
|
|
import RenderPass from '../materials/postprocessing/RenderPass.js'
|
|
|
-import FXAAShader from "../materials/postprocessing/FXAAShader.js"
|
|
|
+import FXAAShader from "../materials/postprocessing/FXAAShader.js"
|
|
|
import OutlinePass from "../materials/postprocessing/OutlinePass.js"
|
|
|
import BasicMaterial from '../materials/BasicMaterial.js'
|
|
|
|
|
@@ -347,20 +347,15 @@ export class Viewer extends ViewerBase{
|
|
|
//add: for 截图时抗锯齿
|
|
|
|
|
|
{
|
|
|
- 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
|
|
|
- //见 https://threejs.org/examples/?q=AA#webgl_postprocessing_fxaa 效果和SSAA差不多,都对透明不太友好。
|
|
|
-
|
|
|
- /* let outlinePass = this.outlinePass = new OutlinePass( );
|
|
|
- this.ssaaRenderPass.addPass(outlinePass)
|
|
|
- */
|
|
|
-
|
|
|
- //for 融合页面
|
|
|
+ /* this.composer = new EffectComposer( this.renderer );
|
|
|
+ this.smaaRenderPass = new SMAAPass(0,0);
|
|
|
+ this.renderPass = new RenderPass( );
|
|
|
+ this.renderPass.clearColor = new THREE.Color( 0, 0, 0 );
|
|
|
+ this.renderPass.clearAlpha = 0;
|
|
|
+ this.composer.addPass( this.renderPass );
|
|
|
+ this.composer.addPass( this.smaaRenderPass ); */
|
|
|
+
|
|
|
+ /* //for 融合页面
|
|
|
let outlinePass = this.outlinePass = new OutlinePass( );
|
|
|
outlinePass.renderToScreen = true //这样更流畅,不用ssaa了,缺点是outline有锯齿
|
|
|
outlinePass.enabled = false
|
|
@@ -369,7 +364,7 @@ export class Viewer extends ViewerBase{
|
|
|
outlinePass.edgeGlow = 0
|
|
|
outlinePass.visibleEdgeColor = new THREE.Color("#09a1b3")
|
|
|
//--------------------------
|
|
|
-
|
|
|
+ */
|
|
|
|
|
|
/* this.composer2 = new EffectComposer( this.renderer );
|
|
|
//const renderPass = new RenderPass();
|
|
@@ -387,7 +382,28 @@ export class Viewer extends ViewerBase{
|
|
|
this.composer2.addPass( this.fxaaPass );
|
|
|
this.composer2.readTarget = true
|
|
|
*/
|
|
|
+
|
|
|
+ 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 );
|
|
|
+
|
|
|
|
|
|
+ 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.fxaaPass.renderToScreen = true;
|
|
|
+
|
|
|
+ this.composer.addPass( this.fxaaPass );
|
|
|
+ //抗锯齿截图 效果时而好时而不好
|
|
|
}
|
|
|
|
|
|
|
|
@@ -629,7 +645,9 @@ export class Viewer extends ViewerBase{
|
|
|
pointcloud.material.addEventListener('material_property_changed',()=>{
|
|
|
this.dispatchEvent('pointcloud_changed')
|
|
|
})
|
|
|
-
|
|
|
+ /* if(Potree.settings.isTest ){
|
|
|
+ this.showBoundingBox = true
|
|
|
+ } */
|
|
|
|
|
|
})
|
|
|
|
|
@@ -3180,12 +3198,12 @@ export class Viewer extends ViewerBase{
|
|
|
viewports = viewports.filter(v=>v.active)
|
|
|
if(viewports.length > 0){
|
|
|
params.viewports = viewports
|
|
|
- if(this.outlinePass.selectedObjects.length && this.outlinePass.edgeStrength > 0 && !params.screenshot){
|
|
|
+ /* if(this.outlinePass.selectedObjects.length && this.outlinePass.edgeStrength > 0 && !params.screenshot){
|
|
|
let scenes = this.inputHandler.interactiveScenes.concat(this.scene.scene).concat(viewer.scene.scenePointCloud)
|
|
|
this.composer.render(scenes, null, this.viewports, this.renderDefault.bind(this));
|
|
|
- }else{
|
|
|
+ }else{ */
|
|
|
this.renderDefault(params);
|
|
|
- }
|
|
|
+ //}
|
|
|
}
|
|
|
if(!specialRender) this.needRender = false
|
|
|
}
|