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

Commit cd898c8

Browse files
committed
Release 0.2.0
1 parent ca890ae commit cd898c8

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

build/RayTracingRenderer.es5.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@
266266

267267
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(EnvironmentLight)).call.apply(_getPrototypeOf2, [this].concat(args)));
268268
_this.map = map;
269+
_this.isEnvironmentLight = true;
269270
return _this;
270271
}
271272

@@ -2066,21 +2067,21 @@
20662067
var directionalLights = [];
20672068
var environmentLights = [];
20682069
scene.traverse(function (child) {
2069-
if (child instanceof THREE$1.Mesh) {
2070+
if (child.isMesh) {
20702071
if (!child.geometry || !child.geometry.getAttribute('position')) {
20712072
console.warn(child, 'must have a geometry property with a position attribute');
2072-
} else if (!(child.material instanceof THREE$1.MeshStandardMaterial)) {
2073+
} else if (!child.material.isMeshStandardMaterial) {
20732074
console.warn(child, 'must use MeshStandardMaterial in order to be rendered.');
20742075
} else {
20752076
meshes.push(child);
20762077
}
20772078
}
20782079

2079-
if (child instanceof THREE$1.DirectionalLight) {
2080+
if (child.isDirectionalLight) {
20802081
directionalLights.push(child);
20812082
}
20822083

2083-
if (child instanceof EnvironmentLight) {
2084+
if (child.isEnvironmentLight) {
20842085
if (environmentLights.length > 1) {
20852086
console.warn(environmentLights, 'only one environment light can be used per scene');
20862087
} else if (isHDRTexture(child)) {

build/RayTracingRenderer.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
constructor(map, ...args) {
4343
super(...args);
4444
this.map = map;
45+
this.isEnvironmentLight = true;
4546
}
4647

4748
copy(source) {
@@ -2842,20 +2843,20 @@ void main() {
28422843
const directionalLights = [];
28432844
const environmentLights = [];
28442845
scene.traverse(child => {
2845-
if (child instanceof THREE$1.Mesh) {
2846+
if (child.isMesh) {
28462847
if (!child.geometry || !child.geometry.getAttribute('position')) {
28472848
console.warn(child, 'must have a geometry property with a position attribute');
28482849
}
2849-
else if (!(child.material instanceof THREE$1.MeshStandardMaterial)) {
2850+
else if (!(child.material.isMeshStandardMaterial)) {
28502851
console.warn(child, 'must use MeshStandardMaterial in order to be rendered.');
28512852
} else {
28522853
meshes.push(child);
28532854
}
28542855
}
2855-
if (child instanceof THREE$1.DirectionalLight) {
2856+
if (child.isDirectionalLight) {
28562857
directionalLights.push(child);
28572858
}
2858-
if (child instanceof EnvironmentLight) {
2859+
if (child.isEnvironmentLight) {
28592860
if (environmentLights.length > 1) {
28602861
console.warn(environmentLights, 'only one environment light can be used per scene');
28612862
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ray-tracing-renderer",
3-
"version": "0.1.4",
3+
"version": "0.2.0",
44
"description": "A [Three.js](https://github.com/mrdoob/three.js/) renderer which utilizes path tracing to render a scene with true photorealism. The renderer supports global illumination, reflections, soft shadows, and realistic environment lighting.",
55
"main": "src/main.js",
66
"scripts": {

0 commit comments

Comments
 (0)