zincjs 1.12.3 → 1.12.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zincjs",
3
- "version": "1.12.3",
3
+ "version": "1.12.4",
4
4
  "description": "ZincJS (Web-based-Zinc-Visualisation)",
5
5
  "main": "build/zinc.js",
6
6
  "directories": {
@@ -226,30 +226,32 @@ const TextureSlides = function (textureIn) {
226
226
 
227
227
  //Expand the boundingbox with slide settings
228
228
  const expandBoxWithSettings = (box, settings, vector) => {
229
- switch (settings.direction.value) {
230
- case 1:
231
- vector.copy(settings.slide.value);
232
- box.expandByPoint(vector);
233
- vector.setY(1.0);
234
- vector.setZ(1.0);
235
- box.expandByPoint(vector);
236
- break;
237
- case 2:
238
- vector.copy(settings.slide.value);
239
- box.expandByPoint(vector);
240
- vector.setX(1.0);
241
- vector.setZ(1.0);
242
- box.expandByPoint(vector);
243
- break;
244
- case 3:
245
- vector.copy(settings.slide.value);
246
- box.expandByPoint(vector);
247
- vector.setX(1.0);
248
- vector.setY(1.0);
249
- box.expandByPoint(vector);
250
- break;
251
- default:
252
- break;
229
+ if (settings) {
230
+ switch (settings.direction.value) {
231
+ case 1:
232
+ vector.copy(settings.slide.value);
233
+ box.expandByPoint(vector);
234
+ vector.setY(1.0);
235
+ vector.setZ(1.0);
236
+ box.expandByPoint(vector);
237
+ break;
238
+ case 2:
239
+ vector.copy(settings.slide.value);
240
+ box.expandByPoint(vector);
241
+ vector.setX(1.0);
242
+ vector.setZ(1.0);
243
+ box.expandByPoint(vector);
244
+ break;
245
+ case 3:
246
+ vector.copy(settings.slide.value);
247
+ box.expandByPoint(vector);
248
+ vector.setX(1.0);
249
+ vector.setY(1.0);
250
+ box.expandByPoint(vector);
251
+ break;
252
+ default:
253
+ break;
254
+ }
253
255
  }
254
256
  }
255
257
 
@@ -9,6 +9,7 @@ precision highp int;
9
9
  precision highp sampler2DArray;
10
10
 
11
11
  uniform sampler2DArray diffuse;
12
+ uniform bool discardAlpha;
12
13
  in vec3 vUw;
13
14
 
14
15
  out vec4 outColor;
@@ -18,7 +19,9 @@ void main() {
18
19
  vec4 color = texture( diffuse, vUw );
19
20
 
20
21
  // lighten a bit
21
- outColor = vec4( color.rgb + .2, 1.0 );
22
+ if (discardAlpha && color.a == 0.0) discard;
23
+
24
+ outColor = vec4( color.rgba );
22
25
 
23
26
  }
24
27
  `;
@@ -58,6 +61,7 @@ const getUniforms = function() {
58
61
  slide: { value: new THREE.Vector3( 0, 0, 1 ) },
59
62
  direction: {value: 1},
60
63
  flipY: { value: true},
64
+ discardAlpha: {value: true},
61
65
  };
62
66
  }
63
67