Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EffectComposer and Outline are changing the scenario #293

Open
samuelndm opened this issue Sep 14, 2024 · 0 comments
Open

EffectComposer and Outline are changing the scenario #293

samuelndm opened this issue Sep 14, 2024 · 0 comments

Comments

@samuelndm
Copy link

samuelndm commented Sep 14, 2024

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>
  );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant