@kitware/vtk.js 25.2.2 → 25.2.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.
@@ -239,7 +239,7 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
239
239
  ' var fresnel: f32 = schlickFresnelIOR(V, normal, ior, k); // Fresnel', ' fresnel = min(1, fresnel);', ' // This could be controlled with its own variable (that isnt base color) for better artistic control', ' var fresnelMetallic: vec3<f32> = schlickFresnelRGB(V, normal, baseColor); // Fresnel for metal, takes color into account', ' var kS: vec3<f32> = mix(vec3<f32>(fresnel), fresnelMetallic, metallic);', ' kS = min(vec3<f32>(1), kS);', ' var kD: vec3<f32> = (1.0 - kS) * (1.0 - metallic);', ' var PBR: vec3<f32> = mapperUBO.DiffuseIntensity*kD*diffuse + kS*specular;', ' PBR += emission;', ' computedColor = vec4<f32>(PBR, mapperUBO.Opacity);']).result;
240
240
  fDesc.setCode(code); // If theres no normals, just set the specular color to be flat
241
241
  } else {
242
- code = vtkWebGPUShaderCache.substitute(code, '//VTK::Light::Impl', [' var diffuse: vec3<f32> = diffuseColor.rgb;', ' var specular: vec3<f32> = mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;', ' computedColor = vec4<f32>(diffuse, mapperUBO.Opacity);']).result;
242
+ code = vtkWebGPUShaderCache.substitute(code, '//VTK::Light::Impl', [' var diffuse: vec3<f32> = diffuseColor.rgb;', ' var specular: vec3<f32> = mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;', ' computedColor = vec4<f32>(diffuse * _diffuseMap.rgb, mapperUBO.Opacity);']).result;
243
243
  fDesc.setCode(code);
244
244
  }
245
245
  };
@@ -290,7 +290,6 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
290
290
  code = vtkWebGPUShaderCache.substitute(code, '//VTK::TCoord::Impl', [' output.tcoordVS = tcoord;' // Ensure that UV coordinates are always between 0-1
291
291
  ]).result;
292
292
  vDesc.setCode(code);
293
- if (model.is2D) return;
294
293
  var fDesc = pipeline.getShaderDescription('fragment');
295
294
  code = fDesc.getCode();
296
295
  var actor = model.WebGPUActor.getRenderable();
@@ -605,36 +604,41 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
605
604
  textures.push(_pair);
606
605
  }
607
606
 
608
- if ((_actor$getProperty$ge15 = (_actor$getProperty9 = actor.getProperty()).getRoughnessTexture) !== null && _actor$getProperty$ge15 !== void 0 && _actor$getProperty$ge15.call(_actor$getProperty9)) {
609
- var _pair2 = ['Roughness', actor.getProperty().getRoughnessTexture()];
607
+ if (model.colorTexture) {
608
+ var _pair2 = ['Diffuse', model.colorTexture];
610
609
  textures.push(_pair2);
611
610
  }
612
611
 
613
- if ((_actor$getProperty$ge16 = (_actor$getProperty10 = actor.getProperty()).getMetallicTexture) !== null && _actor$getProperty$ge16 !== void 0 && _actor$getProperty$ge16.call(_actor$getProperty10)) {
614
- var _pair3 = ['Metallic', actor.getProperty().getMetallicTexture()];
612
+ if ((_actor$getProperty$ge15 = (_actor$getProperty9 = actor.getProperty()).getRoughnessTexture) !== null && _actor$getProperty$ge15 !== void 0 && _actor$getProperty$ge15.call(_actor$getProperty9)) {
613
+ var _pair3 = ['Roughness', actor.getProperty().getRoughnessTexture()];
615
614
  textures.push(_pair3);
616
615
  }
617
616
 
618
- if ((_actor$getProperty$ge17 = (_actor$getProperty11 = actor.getProperty()).getNormalTexture) !== null && _actor$getProperty$ge17 !== void 0 && _actor$getProperty$ge17.call(_actor$getProperty11)) {
619
- var _pair4 = ['Normal', actor.getProperty().getNormalTexture()];
617
+ if ((_actor$getProperty$ge16 = (_actor$getProperty10 = actor.getProperty()).getMetallicTexture) !== null && _actor$getProperty$ge16 !== void 0 && _actor$getProperty$ge16.call(_actor$getProperty10)) {
618
+ var _pair4 = ['Metallic', actor.getProperty().getMetallicTexture()];
620
619
  textures.push(_pair4);
621
620
  }
622
621
 
623
- if ((_actor$getProperty$ge18 = (_actor$getProperty12 = actor.getProperty()).getAmbientOcclusionTexture) !== null && _actor$getProperty$ge18 !== void 0 && _actor$getProperty$ge18.call(_actor$getProperty12)) {
624
- var _pair5 = ['AmbientOcclusion', actor.getProperty().getAmbientOcclusionTexture()];
622
+ if ((_actor$getProperty$ge17 = (_actor$getProperty11 = actor.getProperty()).getNormalTexture) !== null && _actor$getProperty$ge17 !== void 0 && _actor$getProperty$ge17.call(_actor$getProperty11)) {
623
+ var _pair5 = ['Normal', actor.getProperty().getNormalTexture()];
625
624
  textures.push(_pair5);
626
625
  }
627
626
 
628
- if ((_actor$getProperty$ge19 = (_actor$getProperty13 = actor.getProperty()).getEmissionTexture) !== null && _actor$getProperty$ge19 !== void 0 && _actor$getProperty$ge19.call(_actor$getProperty13)) {
629
- var _pair6 = ['Emission', actor.getProperty().getEmissionTexture()];
627
+ if ((_actor$getProperty$ge18 = (_actor$getProperty12 = actor.getProperty()).getAmbientOcclusionTexture) !== null && _actor$getProperty$ge18 !== void 0 && _actor$getProperty$ge18.call(_actor$getProperty12)) {
628
+ var _pair6 = ['AmbientOcclusion', actor.getProperty().getAmbientOcclusionTexture()];
630
629
  textures.push(_pair6);
631
630
  }
632
631
 
633
- if ((_renderer$getBackgrou = renderer.getBackgroundTexture) !== null && _renderer$getBackgrou !== void 0 && _renderer$getBackgrou.call(renderer)) {
634
- var _pair7 = ['Background', renderer.getBackgroundTexture()];
632
+ if ((_actor$getProperty$ge19 = (_actor$getProperty13 = actor.getProperty()).getEmissionTexture) !== null && _actor$getProperty$ge19 !== void 0 && _actor$getProperty$ge19.call(_actor$getProperty13)) {
633
+ var _pair7 = ['Emission', actor.getProperty().getEmissionTexture()];
635
634
  textures.push(_pair7);
636
635
  }
637
636
 
637
+ if ((_renderer$getBackgrou = renderer.getBackgroundTexture) !== null && _renderer$getBackgrou !== void 0 && _renderer$getBackgrou.call(renderer)) {
638
+ var _pair8 = ['Background', renderer.getBackgroundTexture()];
639
+ textures.push(_pair8);
640
+ }
641
+
638
642
  for (var i = 0; i < textures.length; i++) {
639
643
  if (textures[i][1].getInputData() || textures[i][1].getJsImageData() || textures[i][1].getCanvas()) {
640
644
  newTextures.push(textures[i]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "25.2.2",
3
+ "version": "25.2.3",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",