Skip to content

Commit

Permalink
feat(light): increase luma, align chroma with renderapi, add silhouet…
Browse files Browse the repository at this point in the history
…te light

BREAKING CHANGE: AvatarProps, LightingProps
  • Loading branch information
ericjansenrpm committed Jan 4, 2024
1 parent 2e042dd commit b910499
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/BaseCanvas/BaseCanvas.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const BaseCanvas: FC<BaseCanvasProps> = ({
key={fov}
className={`${styles['base-canvas']} ${className ?? ''}`}
shadows="soft"
gl={{ preserveDrawingBuffer: true, alpha: true, toneMappingExposure: 1.4, toneMapping: ACESFilmicToneMapping }}
gl={{ preserveDrawingBuffer: true, alpha: true, toneMappingExposure: 1.6, toneMapping: ACESFilmicToneMapping }}
dpr={dpr}
camera={{ fov, position }}
resize={{ scroll: true, debounce: { scroll: 50, resize: 0 } }}
Expand Down
22 changes: 16 additions & 6 deletions src/components/Lights/Lights.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ export const LIGHT_CONFIG = Object.freeze({
fillLightAngle: Math.PI / 3,
backLightAngle: Math.PI / 8,
keyLightAngle: Math.PI,
silhouetteLightAngle: Math.PI * 1.5,
keyLightPosition: new Vector3(0.5, 1.55, 0.5),
liftLightPosition: new Vector3(0.25, 1.7, 2.0),
dirLightPosition: new Vector3(-0.75, 2.5, -1.0),
silhouetteLightPosition: new Vector3(-1.5, 0.1, -1.5),
defaultProps: {
keyLightIntensity: 1.2,
keyLightColor: '#e8e3df',
fillLightIntensity: 0.7,
fillLightColor: '#99ccff',
keyLightColor: '#FFFFFF',
fillLightIntensity: 0.8,
fillLightColor: '#6794FF',
fillLightPosition: new Vector3(-0.5, 1.6, -0.5),
backLightIntensity: 2.3,
backLightColor: '#fff0d6',
backLightIntensity: 2.2,
backLightColor: '#FFB878',
backLightPosition: new Vector3(0.5, 1.6, -1.0),
lightTarget: new Vector3(0.0, 1.7, 0.0)
} as Required<LightingProps>
Expand Down Expand Up @@ -87,7 +89,15 @@ const Lights: FC<LightingProps> = (lightingProps) => {
target={targets.shoe}
angle={LIGHT_CONFIG.keyLightAngle}
color={keyLightColor}
intensity={keyLightIntensity * 0.16}
intensity={keyLightIntensity * 0.25}
/>
{/* Silhouette light on arms and legs. */}
<spotLight
position={LIGHT_CONFIG.silhouetteLightPosition}
target={targets.head}
angle={LIGHT_CONFIG.silhouetteLightAngle}
color={keyLightColor}
intensity={keyLightIntensity * 0.25}
/>
{/* Dummy directional light for shadow casting from behind avatar. */}
<directionalLight position={LIGHT_CONFIG.dirLightPosition} target={targets.shoe} castShadow intensity={0.0} />
Expand Down

0 comments on commit b910499

Please sign in to comment.