Skip to content

Commit 9441bf2

Browse files
committed
fix colors and lighting
1 parent e304990 commit 9441bf2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/ui/gfx-helpers.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export async function getTexture(imageUrl: string): Promise<Texture> {
3737
const image = new Image();
3838
image.crossOrigin = "";
3939
const texture = new Texture(image);
40+
texture.colorSpace = "srgb";
4041
image.onload = () => {
4142
texture.needsUpdate = true;
4243
resolve(texture);
@@ -154,7 +155,7 @@ export function createWalls(dimensions: Vec) {
154155
}
155156

156157
export function createTopLight(dimensions: Vec) {
157-
const light = new DirectionalLight(0xffffff, 0.25);
158+
const light = new DirectionalLight(0xffffff, 5 * 0.25);
158159
light.position.set(0, dimensions.y + 5, 0);
159160
light.castShadow = true;
160161
light.shadow.camera.left = -dimensions.x / 2;
@@ -166,7 +167,7 @@ export function createTopLight(dimensions: Vec) {
166167
}
167168

168169
export function createFrontLight(dimensions: Vec) {
169-
const light = new DirectionalLight(0xffffff, 0.35);
170+
const light = new DirectionalLight(0xffffff, 5 * 0.35);
170171
light.position.set(0, -dimensions.y * 0.1, 10);
171172
return light;
172173
}

src/ui/gfx.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class Gfx {
8282
new Vector3(-2 - pieceHudPos.x, pieceHudPos.y, pieceHudZ)
8383
);
8484

85-
this.ambientLight = new AmbientLight(0xffffff, 0.6);
85+
this.ambientLight = new AmbientLight(0xffffff, 5 * 0.2);
8686
this.directionalLightTop = createTopLight(dimensions);
8787
this.directionalLightFront = createFrontLight(dimensions);
8888

0 commit comments

Comments
 (0)