-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix(performance): ACT-1219 performance optimisations #109
base: main
Are you sure you want to change the base?
Conversation
fade={0.02} | ||
rings={8} | ||
/> | ||
<N8AO quality="performance" aoRadius={5} distanceFalloff={0.25} intensity={3} screenSpaceRadius halfRes /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing with a more performant ao
@@ -363,7 +357,7 @@ const Avatar: FC<AvatarProps> = ({ | |||
/> | |||
)} | |||
{effects?.vignette && <Vignette eskil={false} offset={0.5} darkness={0.5} />} | |||
<BrightnessContrast brightness={0.025} contrast={0.25} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently bugged alongside the ao causing white flickering, will see if there is a fix available rather than outright removing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reintroduced with a small increase instead.
@@ -22,16 +23,17 @@ export const BaseCanvas: FC<BaseCanvasProps> = ({ | |||
fov = 50, | |||
position = new Vector3(0, 0, 5), | |||
style, | |||
dpr = [BASE_DPR * 0.5, 2], | |||
className | |||
dpr = [BASE_DPR * 0.5, BASE_DPR * 0.75], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing with reduced dpr values, probably wont be final
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might set the top range to 1, then we can handover implementation details on the best value(s)
@@ -67,10 +67,8 @@ export const Model: FC<ModelProps> = ({ | |||
|
|||
if ((node as Mesh).isMesh) { | |||
node.castShadow = true; | |||
} | |||
|
|||
if (node.type === 'SkinnedMesh') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As attachments are Mesh, lets not differentiate between mesh and skinnedmesh.
@@ -18,6 +18,7 @@ export const AvatarDevelop: React.FC = () => ( | |||
effects={{ | |||
ambientOcclusion: true | |||
}} | |||
canvasConfig={{ alpha: false }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alpha can be turned off for scenes which don't need.
@@ -102,7 +100,6 @@ const Lights: FC<LightingProps> = (lightingProps) => { | |||
angle={LIGHT_CONFIG.silhouetteLightAngle} | |||
color={keyLightColor} | |||
intensity={keyLightIntensity * 0.25} | |||
castShadow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed castShadow from lights which shadows don't have an effect.
@@ -348,28 +355,17 @@ const Avatar: FC<AvatarProps> = ({ | |||
/> | |||
{AvatarModel} | |||
{children} | |||
{shadows && <ContactShadows position={[0, 0, 0]} opacity={2} scale={10} blur={1.0} far={1.0} />} | |||
{shadows && ( | |||
<ContactShadows opacity={effects?.ambientOcclusion ? 1 : 2} scale={4} blur={2} far={1.0} resolution={256} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ao and shadows don't behave well together, change the oopacity values depending on if its enabled or not.
Ticket: https://ready-player-me.atlassian.net/jira/software/c/projects/ACT/boards/46?selectedIssue=ACT-1219
Recommendations for integration optimisation:
Example with PlayerZero:
before:
after:
by setting the canvas size appropriately (this will be too much but as an example), we can easily reduce GPU usage by 4%.