react-postprocessing icon indicating copy to clipboard operation
react-postprocessing copied to clipboard

EffectComposer and Outline are changing the scenario

Open samuelndm opened this issue 1 year ago • 1 comments

When I add them, is not just adding the outline to the object, is altering all the scene and making brighter.

<OutlineEffect enabled={isShiny} auraColor={`#ecd08c`}>
        <primitive
          ref={characterRef}
          object={sceneClone}
          rotation={rotation}
          castShadow
          receiveShadow
        />
</OutlineEffect>

const OutlineEffect = ({ children, enabled, auraColor }: Props) => {
  return (
    <Selection enabled>
      <EffectComposer autoClear={false}>
        <Outline
          selectionLayer={10} // selection layer
          blendFunction={BlendFunction.SCREEN} // set this to BlendFunction.ALPHA for dark outlines
          patternTexture={null} // a pattern texture
          edgeStrength={5} // the edge strength
          pulseSpeed={0} // a pulse speed. A value of zero disables the pulse effect
          visibleEdgeColor={auraColor} // the color of visible edges
          hiddenEdgeColor={0x22090a} // the color of hidden edges
          resolutionX={Resolution.AUTO_SIZE} // The horizontal resolution.
          resolutionY={Resolution.AUTO_SIZE} // The vertical resolution.
          kernelSize={KernelSize.VERY_SMALL} // blur kernel size
          blur={true} // whether the outline should be blurred
          xRay={true} // indicates whether X-Ray outlines are enabled
        />
      </EffectComposer>

      <Select enabled={enabled}>{children}</Select>
    </Selection>
  );
};

samuelndm avatar Sep 14 '24 17:09 samuelndm

Outline doesn't work in my project as well with @react-three/fiber 8.2.2 and @react-three/postprocessing 2.16.5 in minimal setup.

karo1404 avatar Jan 07 '25 11:01 karo1404