zincjs 2.4.1-beta.4 → 2.4.1-beta.6

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
@@ -55,6 +55,16 @@ renderer.animate();
55
55
 
56
56
  `initialiseVisualisation` is asynchronous and must finish before any scene is used. Other formats can be loaded with `scene.loadGLTF`, `scene.loadOBJ` and `scene.loadSTL`, and NIfTI images with `Zinc.createPrimitivesFromNIFTI`.
57
57
 
58
+ ### Render on demand
59
+
60
+ By default the renderer draws every animation frame. To only draw when something has changed, which saves GPU time and battery on idle pages, enable render on demand:
61
+
62
+ ```javascript
63
+ renderer.setRenderOnDemand(true);
64
+ ```
65
+
66
+ Camera movement, playback, loading, changes made through the ZincJS APIs and changes to scene properties such as `displayMinimap`, `displayMiniAxes` or `displayMarkers` request a frame automatically. Call `renderer.invalidate()` after changing three.js objects directly, or after changing the three.js renderer from `getThreeJSRenderer()`, e.g. `setClearColor`. Pre-render callbacks still run every frame and can call `invalidate()`; post-render callbacks only run when a frame is drawn.
67
+
58
68
  Useful links:
59
69
 
60
70
  * [Examples](https://github.com/alan-wu/ZincJS-Examples/)