three.js抗锯齿

cube模型抗锯齿

没有使用EffectComposer后处理的时候

    this.renderer = new THREE.WebGLRenderer({
    
    
       // 增加以下属性 抗锯齿
        antialias:true,
        alpha:true
    });

当使用了EffectComposer时

    // 抗锯齿
    let effectFXAA = new ShaderPass(FXAAShader);
    effectFXAA.uniforms['resolution'].value.set(1/window.innerWidth,1/window.innerHeight);
    composer.addPass(FXAAShaderPass);

猜你喜欢

转载自blog.csdn.net/weixin_41993525/article/details/110728334