Skip to content

Commit

Permalink
enable physically correct lights (don mccurdy fan club), disable tone…
Browse files Browse the repository at this point in the history
… mapping
  • Loading branch information
alex-shortt committed Nov 28, 2022
1 parent 8e2b120 commit 168827e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/ideas/mediated/LostFloor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function LostFloor() {
fragHead +
shader.fragmentShader.replace(
"#include <color_fragment>",
"#include <color_fragment>\n" + fragColorFragment
"#include <color_fragment>\n " + fragColorFragment
);
};
return m;
Expand Down Expand Up @@ -199,5 +199,5 @@ const fragHead = `

const fragColorFragment = `
diffuseColor.rgb -= 0.2 * (snoise(vPos) + 1.) / 2.;
diffuseColor.r -= 0.1 * (snoise(-vPos) + 1.) / 2.;
diffuseColor.r -= 0.025 * (snoise(-vPos) + 1.) / 2.;
`;
4 changes: 2 additions & 2 deletions src/ideas/ui/TextInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,15 @@ export function TextInput(props: TextProps) {
<RoundedBox
args={[INPUT_WIDTH, INPUT_HEIGHT, DEPTH]}
radius={RADIUS}
smoothness={8}
smoothness={6}
>
<meshStandardMaterial color="white" />
</RoundedBox>
</Interactable>
<RoundedBox
args={[OUTER_WIDTH, OUTER_HEIGHT, DEPTH]}
radius={RADIUS}
smoothness={8}
smoothness={6}
position-z={-0.001}
>
{/* @ts-ignore */}
Expand Down
3 changes: 3 additions & 0 deletions src/layers/Environment/logic/canvas.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Props as ContainerProps } from "@react-three/fiber/dist/declarations/src/web/Canvas";
import { ResizeObserver } from "@juggle/resize-observer";
import { NoToneMapping } from "three";

export const defaultCanvasProps: Partial<ContainerProps> = {
gl: {
Expand All @@ -8,6 +9,8 @@ export const defaultCanvasProps: Partial<ContainerProps> = {
depth: true,
alpha: false,
stencil: false,
physicallyCorrectLights: true,
toneMapping: NoToneMapping,
},
shadows: false,
camera: { position: [0, 2, 0], near: 0.01, far: 300 },
Expand Down
4 changes: 2 additions & 2 deletions src/layers/Toolbelt/ideas/Lights.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default function Lights() {
return (
<group name="lights">
<ambientLight intensity={0.5} />
<pointLight intensity={0.5} />
<ambientLight intensity={Math.PI * 0.5} />
<pointLight intensity={Math.PI * 0.5} />
</group>
);
}
1 change: 1 addition & 0 deletions src/tools/Camera/logic/photo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const usePhotography = (
precision: "highp",
antialias: true,
});
r.physicallyCorrectLights = true;
r.toneMapping = NoToneMapping;
r.outputEncoding = sRGBEncoding;
return r;
Expand Down
4 changes: 2 additions & 2 deletions src/worlds/Lost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export function LostWorld() {
return (
<group name="lost-world">
<Fog color="white" near={0.1} far={15} />
<directionalLight position-y={1} intensity={0.6} />
<ambientLight intensity={0.6} />
<directionalLight position-y={1} intensity={1.8} />
<ambientLight intensity={1} />
<Background color="white" />
<LostFloor />
</group>
Expand Down

0 comments on commit 168827e

Please sign in to comment.