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/build/zinc.frontend.js +1 -1
- package/build/zinc.js +3 -3
- package/build/zinc.js.map +1 -1
- package/package.json +1 -1
- package/src/primitives/textureSlides.js +26 -24
- package/src/shaders/textureSlide.js +5 -1
package/package.json
CHANGED
|
@@ -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
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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
|
-
|
|
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
|
|