Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Commit 90d3dcb

Browse files
author
Lucas Crane
authored
fix module import (#29)
1 parent d3d6258 commit 90d3dcb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { EnvironmentLight } from './EnvironmentLight';
55
import { RayTracingMaterial } from './RayTracingMaterial';
66
import { RayTracingRenderer } from './RayTracingRenderer';
77

8-
/* global THREE */
9-
if (THREE) {
8+
if (window.THREE) {
9+
/* global THREE */
1010
THREE.LensCamera = LensCamera;
1111
THREE.SoftDirectionalLight = SoftDirectionalLight;
1212
THREE.EnvironmentLight = EnvironmentLight;

src/renderer/RayTracingShader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as THREE from 'three';
22
import fragString from './glsl/rayTrace.frag';
3+
import { EnvironmentLight } from '../EnvironmentLight';
34
import { createShader, createProgram, getUniforms } from './glUtil';
45
import { mergeMeshesToGeometry } from './mergeMeshesToGeometry';
56
import { bvhAccel, flattenBvh } from './bvhAccel';
@@ -266,7 +267,7 @@ function decomposeScene(scene) {
266267
if (child instanceof THREE.DirectionalLight) {
267268
directionalLights.push(child);
268269
}
269-
if (child instanceof THREE.EnvironmentLight) {
270+
if (child instanceof EnvironmentLight) {
270271
if (environmentLights.length > 1) {
271272
console.warn(environmentLights, 'only one environment light can be used per scene');
272273
}

0 commit comments

Comments
 (0)