Commit 2761c9ae authored by Stoll's avatar Stoll
Browse files

Added ambient light

parent e3227928
...@@ -42,7 +42,7 @@ export const XRRenderer: React.FC = () => { ...@@ -42,7 +42,7 @@ export const XRRenderer: React.FC = () => {
mountRef.current.appendChild(button); mountRef.current.appendChild(button);
// --- Lighting --- // --- Lighting ---
const light = new THREE.HemisphereLight(0xffffff, 0xbbbbff, 1); const light = new THREE.AmbientLight(0xffffff, 0.5);
scene.add(light); scene.add(light);
// --- Block manager --- // --- Block manager ---
......
import * as THREE from "three"; import * as THREE from "three";
import type { IRenderable } from "./IRenderable"; import type { IRenderable } from "./IRenderable";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"; import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
import {Texture} from "three";
export class GLTFModel implements IRenderable { export class GLTFModel implements IRenderable {
mesh: THREE.Object3D; mesh: THREE.Object3D;
...@@ -24,6 +25,11 @@ export class GLTFModel implements IRenderable { ...@@ -24,6 +25,11 @@ export class GLTFModel implements IRenderable {
throw new Error(`GLB file not found: ${url}`); throw new Error(`GLB file not found: ${url}`);
} }
const textureLoader = new THREE.TextureLoader();
const texture : Texture = textureLoader.load("/Textures/variation-a.png");
texture.colorSpace = THREE.SRGBColorSpace;
const loader = new GLTFLoader(); const loader = new GLTFLoader();
loader.load( loader.load(
url, url,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment