@polygon-streaming/web-player-threejs 2.4.6 → 2.7.3

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.
package/README.md CHANGED
@@ -40,14 +40,8 @@ Instanciate the stream controller:
40
40
  ```javascript
41
41
  const streamController = new StreamController(camera, renderer, scene, cameraTarget, {
42
42
  cameraType: 'nonPlayer',
43
- triangleBudget: 3000000,
44
- mobileTriangleBudget: 1000000,
45
- closeUpDistance: 0.2,
46
- minimumDistance: 0.01,
47
- distanceFactor: 1.1,
48
- distanceType: 'boundingBoxCenter',
49
- maximumQuality: 15000,
50
- closeUpDistanceFactor: 5,
43
+ triangleBudget: 5000000,
44
+ mobileTriangleBudget: 3000000
51
45
  });
52
46
  ```
53
47
 
@@ -59,16 +53,7 @@ modelParent.position.set(0, 1, 0);
59
53
  scene.add(modelParent);
60
54
 
61
55
  streamController.addModel('<Model URL>', modelParent, {
62
- qualityPriority: 1,
63
- initialTrianglePercent: 0.1,
64
- castShadows: true,
65
- receiveShadows: true,
66
- castShadowsLightmap: true,
67
- forceDoubleSided: false,
68
- useAlpha: true,
69
- useEmbeddedCollider: true,
70
- environmentMap: null,
71
- hashCode: ''
56
+ qualityPriority: 1
72
57
  });
73
58
  ```
74
59
 
@@ -89,21 +74,19 @@ renderer.setAnimationLoop(animate);
89
74
  * **camera** (Required): The camera used in the scene.
90
75
  * **renderer** (Required): The WebGL renderer used in the scene.
91
76
  * **scene** (Required): The scene object.
92
- * **camera target** (Required): The camera target which is a Vector3. If you are using orbit controls it would be controls.target.
77
+ * **cameraTarget** (Required): The camera target which is a Vector3. If you are using orbit controls it would be controls.target.
93
78
  * **options** (Optional): All options are optional. The options are:
94
79
  * **cameraType**: 'nonPlayer' | 'player', default: 'nonPlayer'
95
80
  * **nonPlayer**: A camera that is not attached to a player e.g. a camera that orbits an object.
96
81
  * **player**: A camera that is attached to a player.
97
- * **triangleBudget**: number, default: 3000000. The maximum amount of triangles that you want to be in the scene at any single point.
98
- * **mobileTriangleBudget**: number, default: 1000000. The triangle budget used on a mobile device. If it is set to 0 it will use the non-mobile triangle budget.
82
+ * **triangleBudget**: number, default: 5000000. The maximum amount of triangles that you want to be in the scene at any single point.
83
+ * **mobileTriangleBudget**: number, default: 3000000. The triangle budget used on a mobile device. If it is set to 0 it will use the non-mobile triangle budget.
99
84
  * **minimumDistance**: number, default: 0.01. The smallest possible distance to the camera.
100
85
  * **distanceFactor**: number, default: 1.1. Preference for nearby objects over objects further away. Values above one mean a preference for nearby objects. Values below one mean a preference for objects further away. One is neutral.
101
- * **distanceType**: 'boundingBoxCenter' | 'boundingBox', default: 'boundingBoxCenter'
102
- * **boundingBoxCenter**: Uses the center of the bounding box to caluclate the distance to the node.
103
- * **boundingBox**: Uses the bounding box corners and face centers to calulcate the distance to the node.
104
86
  * **maximumQuality**: number, default: 15000. Stops improving geometry that exceeds the maximum quality. This can be used to stop far away objects from showing more detail which can be wasteful. Setting it to 0 means there is no maximum quality.
105
87
  * **closeUpDistance**: number, default: 3. The distance where it starts using close-up distance factor. Set it to 0 to not use close-up distance factor.
106
88
  * **closeUpDistanceFactor**: number, default: 5. The distance factor used when close-up to an object. Should be higher than the standard distance factor.
89
+ * **iOS Memory Limit**: number, default 0. The maximum amount of memory in MB that meshes and textures can consume on iOS devices to avoid the page crashing. Use -1 for no limit or 0 to let Polygon Streaming determine the limit.
107
90
 
108
91
  ## Streaming Model Parameters
109
92
 
@@ -112,11 +95,12 @@ renderer.setAnimationLoop(animate);
112
95
  * **options** (Optional): All options are optional. The options are:
113
96
  * **qualityPriority**: number, default: 1. How much to prioritize the quality of this model relative to the quality of other models in the scene. This parameter does nothing if this is the only model in the scene.
114
97
  * **initialTrianglePercent**: number, default: 0.1. Percentage of triangle budget to initialize the model with.
115
- * **useMetalRoughness**: boolean, default: true. Whether materials should use metal roughness PBR. (deprecated)
116
98
  * **castShadows**: boolean, default: true. Whether the model should cast shadows.
117
99
  * **receiveShadows**: boolean, default: true. Whether the model should receive shadows.
118
- * **castShadowsLightmap**: boolean, default: true. Whether the model casts shadows when rendering lightmaps.
119
100
  * **forceDoubleSided**: boolean, default: false. Render the model double sided regardless of the setting in the model file.
101
+ * **useAlpha**: boolean, default: true. Whether to render semi-transparency in materials. You might turn this off to increase performance but all your materials will render opaque.
102
+ * **playAnimationAutomatically**: boolean, default: true. Whether to play the embedded animation automatically.
103
+ * **animation**: string or number, default: null. The name or index of the embedded animation to play. An index value of 0 is the first animation. If not value is supplied it will play the first animation.
120
104
  * **environmentMap**: texture, default: null. A cube map environment texture.
121
105
  * **hashCode**: string, default: ''. Hash code to validate streaming model.
122
106