Skip to content

Commit

Permalink
fix(canvas): ACT-1219 fix ao and contact shadow conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarvv committed Dec 19, 2024
1 parent 8527e1f commit a1b8f4d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/Avatar/Avatar.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,9 @@ const Avatar: FC<AvatarProps> = ({
/>
{AvatarModel}
{children}
{shadows && <ContactShadows position={[0, 0, 0]} opacity={2} scale={10} blur={1.0} far={1.0} resolution={256} />}
{shadows && (
<ContactShadows opacity={effects?.ambientOcclusion ? 1 : 2} scale={4} blur={2} far={1.0} resolution={256} />
)}
{background?.src && <Box {...background} />}
{capture && <Capture {...capture} />}
{background?.color && <BackgroundColor color={background.color} />}
Expand Down
2 changes: 1 addition & 1 deletion src/components/BaseCanvas/BaseCanvas.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const BaseCanvas: FC<BaseCanvasProps> = ({
dpr={dpr}
camera={{ fov, position }}
resize={{ scroll: true, debounce: { scroll: 50, resize: 0 } }}
style={{ ...style, background: 'transparent' }}
style={{ ...style, background: canvasConfig.alpha ? 'transparent' : style?.background }}
>
{children}
</Canvas>
Expand Down
1 change: 0 additions & 1 deletion src/components/Models/Model/Model.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export const Model: FC<ModelProps> = ({
if ((node as Mesh).isMesh) {
node.castShadow = true;
node.receiveShadow = true;
node.frustumCulled = false;
}
});

Expand Down

0 comments on commit a1b8f4d

Please sign in to comment.