diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ceb95da6..76da9df3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,4 +5,4 @@ # The '*' pattern is global owners. -* @Zaehiel @blanxii @chikul @tiivik @hanWolf3D \ No newline at end of file +* @readyplayerme/avatars-content-tech-team \ No newline at end of file diff --git a/src/components/Avatar/Avatar.component.tsx b/src/components/Avatar/Avatar.component.tsx index 5a0f5848..a3b24907 100644 --- a/src/components/Avatar/Avatar.component.tsx +++ b/src/components/Avatar/Avatar.component.tsx @@ -2,14 +2,7 @@ import React, { Suspense, FC, useMemo, CSSProperties, ReactNode, useEffect } fro import { Vector3 } from 'three'; import { CameraLighting } from 'src/components/Scene/CameraLighting.component'; import { Environment } from 'src/components/Scene/Environment.component'; -import { - LightingProps, - BaseModelProps, - EnvironmentProps, - BloomConfiguration, - SpawnState, - EffectConfiguration -} from 'src/types'; +import { LightingProps, BaseModelProps, EnvironmentProps, SpawnState, EffectConfiguration } from 'src/types'; import { BaseCanvas } from 'src/components/BaseCanvas'; import { AnimationModel, HalfBodyModel, StaticModel, PoseModel } from 'src/components/Models'; import { isValidFormat, triggerCallback } from 'src/services'; @@ -131,10 +124,6 @@ export interface AvatarProps extends LightingProps, EnvironmentProps, Omit = ({ className, headMovement = false, cameraZoomTarget = CAMERA.CONTROLS.FULL_BODY.ZOOM_TARGET, - bloom, onLoadedEffect, onLoadedAnimation, children, @@ -218,7 +206,7 @@ const Avatar: FC = ({ idleRotation={idleRotation} onLoaded={onLoaded} headMovement={headMovement} - bloom={bloom} + bloom={effects?.bloom} /> ); } @@ -232,7 +220,7 @@ const Avatar: FC = ({ idleRotation={idleRotation} onLoaded={onLoaded} headMovement={headMovement} - bloom={bloom} + bloom={effects?.bloom} /> ); } @@ -245,13 +233,15 @@ const Avatar: FC = ({ scale={scale} poseSrc={poseSrc!} onLoaded={onLoaded} - bloom={bloom} + bloom={effects?.bloom} /> ); } - return ; - }, [halfBody, animationSrc, modelSrc, scale, poseSrc, idleRotation, emotion, onLoaded, headMovement, bloom]); + return ( + + ); + }, [halfBody, animationSrc, modelSrc, scale, poseSrc, idleRotation, emotion, onLoaded, headMovement, effects?.bloom]); useEffect(() => triggerCallback(onLoading), [modelSrc, animationSrc, onLoading]); @@ -281,31 +271,35 @@ const Avatar: FC = ({ {background?.src && } {capture && } {background?.color && } - - - <> - {effects?.ambientOcclusion && ( - - )} - - + {effects && ( + + <> + {effects?.ambientOcclusion && ( + + )} + {effects?.bloom && ( + + )} + + + )} ); }; diff --git a/src/components/FloorReflection/FloorReflection.component.tsx b/src/components/FloorReflection/FloorReflection.component.tsx index f8f441c5..7f1609ae 100644 --- a/src/components/FloorReflection/FloorReflection.component.tsx +++ b/src/components/FloorReflection/FloorReflection.component.tsx @@ -7,7 +7,7 @@ export interface FloorReflectionProps { mixStrength?: number; metalness?: number; blur?: [number, number] | number; - mirror: number; + mirror?: number; minDepthThreshold?: number; maxDepthThreshold?: number; depthScale?: number; @@ -40,7 +40,7 @@ export const FloorReflection: FC = ({ ...props }) => ( <> - + diff --git a/src/components/Models/AnimationModel/AnimationModel.component.tsx b/src/components/Models/AnimationModel/AnimationModel.component.tsx index b87b9734..58aa5b90 100644 --- a/src/components/Models/AnimationModel/AnimationModel.component.tsx +++ b/src/components/Models/AnimationModel/AnimationModel.component.tsx @@ -1,4 +1,4 @@ -import React, { useRef, FC, useMemo } from 'react'; +import React, { useRef, FC, useMemo, useState } from 'react'; import { useFrame, useGraph } from '@react-three/fiber'; import { AnimationMixer, Group } from 'three'; import { Model } from 'src/components/Models/Model'; @@ -29,7 +29,7 @@ export const AnimationModel: FC = ({ bloom }) => { const ref = useRef(null); - const [animationRunning, setAnimationRunning] = React.useState(true); + const [animationRunning, setAnimationRunning] = useState(true); const onSpawnAnimationFinish = () => { setAnimationRunning(false); }; @@ -46,7 +46,7 @@ export const AnimationModel: FC = ({ } const animation = mixer.clipAction(await animationClip); - animation.fadeIn(0.5); + animation.fadeIn(0); animation.play(); mixer.update(0); diff --git a/src/components/Shadow/Shadow.component.tsx b/src/components/Shadow/Shadow.component.tsx index 19bf0841..e61e82e7 100644 --- a/src/components/Shadow/Shadow.component.tsx +++ b/src/components/Shadow/Shadow.component.tsx @@ -3,7 +3,7 @@ import React, { FC } from 'react'; const Shadow: FC = () => ( - + diff --git a/src/types/index.ts b/src/types/index.ts index 1fce75e2..8bf26e11 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -142,6 +142,10 @@ export type EffectConfiguration = { * Enables ambient occlusion for the current scene. */ ambientOcclusion?: boolean; + /** + * Bloom post-processing effect. + */ + bloom?: BloomConfiguration; }; export interface SpawnState {