@kitware/vtk.js 23.4.2 → 23.4.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.
|
@@ -21,6 +21,13 @@ export interface IOptions {
|
|
|
21
21
|
scale: number
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export interface I3DContextOptions {
|
|
25
|
+
preserveDrawingBuffer?: boolean;
|
|
26
|
+
depth?: boolean;
|
|
27
|
+
alpha?: boolean;
|
|
28
|
+
powerPreference?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
type vtkOpenGLRenderWindowBase = vtkObject & Omit<vtkAlgorithm,
|
|
25
32
|
| 'getInputData'
|
|
26
33
|
| 'setInputData'
|
|
@@ -197,9 +204,9 @@ export interface vtkOpenGLRenderWindow extends vtkOpenGLRenderWindowBase {
|
|
|
197
204
|
|
|
198
205
|
/**
|
|
199
206
|
*
|
|
200
|
-
* @param options
|
|
207
|
+
* @param {I3DContextOptions} options
|
|
201
208
|
*/
|
|
202
|
-
get3DContext(options:
|
|
209
|
+
get3DContext(options: I3DContextOptions): Nullable<WebGLRenderingContext>;
|
|
203
210
|
|
|
204
211
|
/**
|
|
205
212
|
*
|
|
@@ -223,7 +223,8 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
223
223
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
224
224
|
preserveDrawingBuffer: false,
|
|
225
225
|
depth: true,
|
|
226
|
-
alpha: true
|
|
226
|
+
alpha: true,
|
|
227
|
+
powerPreference: 'high-performance'
|
|
227
228
|
};
|
|
228
229
|
var result = null; // Do we have webxr support
|
|
229
230
|
|
|
@@ -199,7 +199,9 @@ function vtkWebGPURenderWindow(publicAPI, model) {
|
|
|
199
199
|
switch (_context.prev = _context.next) {
|
|
200
200
|
case 0:
|
|
201
201
|
_context.next = 2;
|
|
202
|
-
return navigator.gpu.requestAdapter(
|
|
202
|
+
return navigator.gpu.requestAdapter({
|
|
203
|
+
powerPreference: 'high-performance'
|
|
204
|
+
});
|
|
203
205
|
|
|
204
206
|
case 2:
|
|
205
207
|
model.adapter = _context.sent;
|