react-postprocessing
react-postprocessing copied to clipboard
EffectComposer and Outline are changing the scenario
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>
);
};
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.