Skip to content

Commit

Permalink
Merge pull request #180 from Benjythebee/add/hdr
Browse files Browse the repository at this point in the history
Looks great!
  • Loading branch information
memelotsqui authored Oct 30, 2024
2 parents 44673e0 + aa7b2fc commit 88b5b2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Binary file added public/hdr/studio_small_09_2k.hdr
Binary file not shown.
16 changes: 14 additions & 2 deletions src/library/sceneInitializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@ import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
import { CharacterManager } from "./characterManager";

import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader';

export function sceneInitializer(canvasId) {
const scene = new THREE.Scene()
const ambientLight = new THREE.AmbientLight(0xffffff, 2);


new RGBELoader().load("./hdr/studio_small_09_2k.hdr", (hdr_) => {
hdr_.mapping = THREE.EquirectangularReflectionMapping;
hdr_.colorSpace = THREE.LinearSRGBColorSpace
scene.environment = hdr_;
})
scene.environmentIntensity = 0.5

const ambientLight = new THREE.AmbientLight(0xffffff, 0.8);
scene.add(ambientLight);

const directionalLight = new THREE.DirectionalLight(0xffffff, 2);
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);

// rotate the directional light to be a key light
directionalLight.position.set(0, 1, 1);
scene.add(directionalLight);
Expand Down

0 comments on commit 88b5b2b

Please sign in to comment.