Skip to content

EffectComposer and Outline are changing the scenario #293

Description

@samuelndm

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>
  );
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions