@kitware/vtk.js 29.5.0 → 29.5.1
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.
|
@@ -745,6 +745,8 @@ function vtkOpenGLImageMapper(publicAPI, model) {
|
|
|
745
745
|
});
|
|
746
746
|
model.openGLTexture.setOpenGLRenderWindow(model._openGLRenderWindow);
|
|
747
747
|
}
|
|
748
|
+
// Use norm16 for scalar texture if the extension is available
|
|
749
|
+
model.openGLTexture.setOglNorm16Ext(model.context.getExtension('EXT_texture_norm16'));
|
|
748
750
|
if (iType === InterpolationType.NEAREST) {
|
|
749
751
|
if (new Set([1, 3, 4]).has(numComp) && dataType === VtkDataTypes.UNSIGNED_CHAR && !iComps) {
|
|
750
752
|
model.openGLTexture.setGenerateMipmap(true);
|
|
@@ -319,18 +319,22 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
319
319
|
default:
|
|
320
320
|
return oglNorm16Ext.RGBA16_SNORM_EXT;
|
|
321
321
|
}
|
|
322
|
+
case VtkDataTypes.UNSIGNED_SHORT:
|
|
323
|
+
case VtkDataTypes.SHORT:
|
|
322
324
|
case VtkDataTypes.FLOAT:
|
|
323
325
|
default:
|
|
326
|
+
// useHalfFloat tells us if the texture can be accurately
|
|
327
|
+
// rendered with 16 bits or not.
|
|
324
328
|
switch (numComps) {
|
|
325
329
|
case 1:
|
|
326
|
-
return model.context.R16F;
|
|
330
|
+
return useHalfFloat ? model.context.R16F : model.context.R32F;
|
|
327
331
|
case 2:
|
|
328
|
-
return model.context.RG16F;
|
|
332
|
+
return useHalfFloat ? model.context.RG16F : model.context.RG32F;
|
|
329
333
|
case 3:
|
|
330
|
-
return model.context.RGB16F;
|
|
334
|
+
return useHalfFloat ? model.context.RGB16F : model.context.RGB32F;
|
|
331
335
|
case 4:
|
|
332
336
|
default:
|
|
333
|
-
return model.context.RGBA16F;
|
|
337
|
+
return useHalfFloat ? model.context.RGBA16F : model.context.RGBA32F;
|
|
334
338
|
}
|
|
335
339
|
}
|
|
336
340
|
}
|
|
@@ -275,6 +275,9 @@ function vtkOpenGLTexture(publicAPI, model) {
|
|
|
275
275
|
if (!model.internalFormat) {
|
|
276
276
|
vtkDebugMacro(`Unable to find suitable internal format for T=${vtktype} NC= ${numComps}`);
|
|
277
277
|
}
|
|
278
|
+
if ([model.context.R32F, model.context.RG32F, model.context.RGB32F, model.context.RGBA32F].includes(model.internalFormat) && !model.context.getExtension('OES_texture_float_linear')) {
|
|
279
|
+
vtkWarningMacro('Failed to load OES_texture_float_linear. Texture filtering is not available for *32F internal formats.');
|
|
280
|
+
}
|
|
278
281
|
return model.internalFormat;
|
|
279
282
|
};
|
|
280
283
|
|