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

Commit e91c4a2

Browse files
committed
Release 0.9.2
1 parent f56fc43 commit e91c4a2

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

build/RayTracingRenderer.es5.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,11 +1934,6 @@
19341934
}
19351935

19361936
var dim = maximumExtent(centroidBounds);
1937-
1938-
if (centroidBounds.max[dim] === centroidBounds.min[dim]) {
1939-
return makeLeafNode(primitiveInfo.slice(start, end), bounds);
1940-
}
1941-
19421937
var mid = Math.floor((start + end) / 2); // middle split method
19431938
// const dimMid = (centroidBounds.max[dim] + centroidBounds.min[dim]) / 2;
19441939
// mid = partition(primitiveInfo, p => p.center[dim] < dimMid, start, end);
@@ -1952,6 +1947,9 @@
19521947
nthElement(primitiveInfo, function (a, b) {
19531948
return a.center[dim] < b.center[dim];
19541949
}, start, end, mid);
1950+
} else if (centroidBounds.max[dim] === centroidBounds.min[dim]) {
1951+
// can't split primitives based on centroid bounds. terminate.
1952+
return makeLeafNode(primitiveInfo.slice(start, end), bounds);
19551953
} else {
19561954
var buckets = [];
19571955

build/RayTracingRenderer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,9 +1672,6 @@ vec3 getMatNormal(int materialIndex, vec2 uv, vec3 normal, vec3 dp1, vec3 dp2, v
16721672
}
16731673
const dim = maximumExtent(centroidBounds);
16741674

1675-
if (centroidBounds.max[dim] === centroidBounds.min[dim]) {
1676-
return makeLeafNode(primitiveInfo.slice(start, end), bounds);
1677-
}
16781675

16791676
let mid = Math.floor((start + end) / 2);
16801677

@@ -1690,7 +1687,11 @@ vec3 getMatNormal(int materialIndex, vec2 uv, vec3 normal, vec3 dp1, vec3 dp2, v
16901687
// surface area heuristic method
16911688
if (nPrimitives <= 4) {
16921689
nthElement(primitiveInfo, (a, b) => a.center[dim] < b.center[dim], start, end, mid);
1690+
} else if (centroidBounds.max[dim] === centroidBounds.min[dim]) {
1691+
// can't split primitives based on centroid bounds. terminate.
1692+
return makeLeafNode(primitiveInfo.slice(start, end), bounds);
16931693
} else {
1694+
16941695
const buckets = [];
16951696
for (let i = 0; i < 12; i++) {
16961697
buckets.push({

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.9.1",
3+
"version": "0.9.2",
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": "build/RayTracingRenderer.js",
66
"scripts": {

0 commit comments

Comments
 (0)