THREE.js blur the frame buffer

前端 未结 2 1954
执笔经年
执笔经年 2021-02-03 15:20

I need to blur the frame buffer and I don\'t know how to get the frame buffer using THREE.js.

I want to blur the whole frame buffer rather than blur each texture

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-03 16:11

    Try using the MeshDepthMaterial and render this into your shader.

    I suggest rendering the blur pass with a dedicated camera using the same settings as the scene's diffuse camera. Then by adjusting the camera's frustrum you can do both screen and depth of blur effects. For a screen setup move the near frustrum towards the camera and move the far frustrum in increments away from the camera.

    http://threejs.org/docs/#Reference/Materials/MeshDepthMaterial

提交回复
热议问题