ssao

How to use the three.js SSAO shader?

旧城冷巷雨未停 提交于 2019-12-02 01:25:31
I'm trying to render a scene with the SSAO post-processing shader. There aren't any errors but I can't see any difference between the scene rendered with and without the SSAO pass. I initialize the renderer like this: // Create WebGL Renderer var renderParameters = { antialias: false, alpha: false, clearColor: 0xFFFFFF }; renderer = new THREE.WebGLRenderer(renderParameters); renderer.autoClear = false; renderer.setSize(viewportWidth, viewportHeight); // Create render targets renderTargetParametersRGB = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };

SSAO artefacts in Three

北慕城南 提交于 2019-12-01 10:39:50
I'm really struggling to fix an issue with my SSAO shader and could desperately use some help. Basically the shader seems to work on some objects, but looks really bad on others. From the below you can see the sphere looks correct, but the cube seems to be doing occlusion on normals that it shouldn't. Here is a screenshot: I am basing my shaders off of this tutorial: http://devmaster.net/posts/3095/shader-effects-screen-space-ambient-occlusion In my render chain I render 2 render targets which get used in some post process effects later on. One of them stores the position and depth. The other