Skip to content

Commit 5fa19e8

Browse files
committed
Fixed delays when loading multiple models.
Problem was having too many concurrent workers opened at once. Garbage collection apparently works very slowly on workers. Solution was to close them manually, after model data is sent to main thread. Also some progress with Blender scene exporter. Some scenes now export correctly, though monkey test scene got worse, even with less hacky code.
1 parent 9226142 commit 5fa19e8

31 files changed

+1044
-927
lines changed

build/Three.js

+204-200
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/ThreeExtras.js

+34-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/ThreeWebGL.js

+99-95
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/obj/blenderscene/scene.Cube.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,29 @@
88
* uvs: 0
99
* colors: 0
1010
* materials: 1
11+
* edges: 0
1112
*
1213
*/
1314

1415
var model = {
1516

1617
"version" : 2,
1718

19+
"scale" : 1.000000,
20+
1821
"materials": [ {
1922
"DbgColor" : 15658734,
2023
"DbgIndex" : 0,
2124
"DbgName" : "Material",
2225
"colorAmbient" : [0.0, 0.0, 0.0],
2326
"colorDiffuse" : [0.6400000190734865, 0.10179081114814892, 0.126246120426746],
2427
"colorSpecular" : [0.5, 0.5, 0.5],
25-
"shading" : "Phong",
2628
"specularCoef" : 50,
2729
"transparency" : 1.0,
2830
"vertexColors" : false
2931
}],
3032

31-
"vertices": [1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,-1.000000,-1.000000,1.000000,-1.000000,-1.000000,-1.000000,1.000000,1.000000,-1.000000,0.999999,1.000000,1.000001,-1.000000,1.000000,1.000000,-1.000000,1.000000,-1.000000],
33+
"vertices": [1.000000,1.000000,-1.000000,1.000000,-1.000000,-1.000000,-1.000000,-1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,1.000000,1.000000,0.999999,-1.000001,1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,1.000000],
3234

3335
"morphTargets": [],
3436

@@ -38,8 +40,11 @@ var model = {
3840

3941
"uvs": [[]],
4042

41-
"faces": [3,0,1,2,3,0,3,4,7,6,5,0,3,0,4,5,1,0,3,1,5,6,2,0,3,2,6,7,3,0,3,4,0,3,7,0]
43+
"faces": [3,0,1,2,3,0,3,4,7,6,5,0,3,0,4,5,1,0,3,1,5,6,2,0,3,2,6,7,3,0,3,4,0,3,7,0],
44+
45+
"edges" : []
4246

4347
};
4448

4549
postMessage( model );
50+
close();

examples/obj/blenderscene/scene.Monkey.js

+8-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/obj/blenderscene/scene.Plane.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,29 @@
88
* uvs: 0
99
* colors: 0
1010
* materials: 1
11+
* edges: 0
1112
*
1213
*/
1314

1415
var model = {
1516

1617
"version" : 2,
1718

19+
"scale" : 1.000000,
20+
1821
"materials": [ {
1922
"DbgColor" : 15658734,
2023
"DbgIndex" : 0,
2124
"DbgName" : "Material.001",
2225
"colorAmbient" : [0.0, 0.0, 0.0],
2326
"colorDiffuse" : [0.14462547517754842, 0.6400000190734865, 0.24541190036254967],
2427
"colorSpecular" : [0.5, 0.5, 0.5],
25-
"shading" : "Phong",
2628
"specularCoef" : 50,
2729
"transparency" : 1.0,
2830
"vertexColors" : false
2931
}],
3032

31-
"vertices": [1.000000,-0.000000,-1.000000,1.000000,0.000000,1.000000,-1.000000,0.000000,1.000000,-1.000000,-0.000000,-1.000000],
33+
"vertices": [1.000000,1.000000,0.000000,1.000000,-1.000000,0.000000,-1.000000,-1.000000,0.000000,-1.000000,1.000000,0.000000],
3234

3335
"morphTargets": [],
3436

@@ -38,8 +40,11 @@ var model = {
3840

3941
"uvs": [[]],
4042

41-
"faces": [3,0,3,2,1,0]
43+
"faces": [3,0,3,2,1,0],
44+
45+
"edges" : []
4246

4347
};
4448

4549
postMessage( model );
50+
close();

0 commit comments

Comments
 (0)