Drawing outlines makes my scene dark

Hi
I’m using outlines from example on threejs.org, but I have a little problem, I copied code from https://gltf-viewer.donmccurdy.com/ and everything works fine as you can see on this picture:

But, when I implemented outlines (same code as in example) my scene went to this:

When i dissable drawing EffectComposer everything is back in normal, any suggestions? The backgroud is Sky from examples (turning off changes nothing), and envinroment map behind is also dark.

My config of renderer is

    renderer.setPixelRatio(window.devicePixelRatio);
    renderer.setSize(window.innerWidth, window.innerHeight);
    renderer.setClearColor(0xFFFFFF, 1)

    renderer.outputEncoding = THREE.sRGBEncoding;
    renderer.physicallyCorrectLights = true
    renderer.shadowMap.enabled = true

my lights are:

    const ambientColor = 0xFFFFFF
    const ambientIntensity = 0.3
    const directIntensity = 0.8 * Math.PI
    const directColor = 0xFFFFFF

    const light1 = new three.AmbientLight(ambientColor, ambientIntensity);
    light1.name = 'ambient_light';
    scene.add(light1);

    const light2 = new three.DirectionalLight(directColor, directIntensity);
    light2.position.set(0.5, 0, 0.866); // ~60º
    light2.name = 'main_light'
    light2.castShadow = true
    light2.shadow.mapSize.width = 1024
    light2.shadow.mapSize.height = 1024

    scene.add(light2);
3 Likes

have you solve this problem, i got stuck here too

1 Like

Hi, no I disabled outlines because outlines FAXX is not supported on oculus and causes problems… you have to find some materials supporting it. Or write custom opengl methods…

Having the same problem…

You need to add an OutputPass at the end of your effect chain. See How to add OutlinePass but not modify the default scene color? and three.js/examples/webgl_postprocessing_outline.html at 0ea870f6d70be2886fa035d204404b5448f3c6a6 · mrdoob/three.js · GitHub

1 Like