viral-viewer-2 3.1.2 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -34104,17 +34104,17 @@ function workerFunction() {
|
|
|
34104
34104
|
dummyGeometry.computeVertexNormals();
|
|
34105
34105
|
if (event.data.Instances.length > 0) {
|
|
34106
34106
|
let geometry = new BufferGeometry();
|
|
34107
|
-
// In case number of polygon larger than expect, merge them to reduce polygon first, for optimize purpose
|
|
34108
|
-
if (dummyGeometry.attributes.position.count > maxPolygonPerObject) {
|
|
34109
|
-
|
|
34110
|
-
|
|
34111
|
-
|
|
34112
|
-
|
|
34113
|
-
|
|
34114
|
-
}
|
|
34115
|
-
|
|
34116
|
-
|
|
34117
|
-
|
|
34107
|
+
// // In case number of polygon larger than expect, merge them to reduce polygon first, for optimize purpose
|
|
34108
|
+
// if (dummyGeometry.attributes.position.count > maxPolygonPerObject) {
|
|
34109
|
+
// let modifier = new SimplifyModifier();
|
|
34110
|
+
// // const ratio = maxPolygonPerObject / dummyGeometry.attributes.position.count;
|
|
34111
|
+
// // const count = Math.floor(dummyGeometry.attributes.position.count * ratio); // number of polygon to remove
|
|
34112
|
+
// } else {
|
|
34113
|
+
// geometry = dummyGeometry;
|
|
34114
|
+
// }
|
|
34115
|
+
let modifier = new SimplifyModifier();
|
|
34116
|
+
geometry = modifier.modify(dummyGeometry, maxPolygonPerObject);
|
|
34117
|
+
console.log(dummyGeometry.attributes.position.count, geometry.attributes.position.count);
|
|
34118
34118
|
const childMesh = new InstancedMesh(geometry, new MeshBasicMaterial(), event.data.Instances.length);
|
|
34119
34119
|
childMesh.castShadow = true;
|
|
34120
34120
|
childMesh.receiveShadow = true;
|