shaders-oneshot 0.0.81-shared.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.
- package/LICENSE +201 -0
- package/NOTICE +5 -0
- package/README.md +7 -0
- package/dist/empty-pixel.d.ts +1 -0
- package/dist/empty-pixel.js +10 -0
- package/dist/empty-pixel.js.map +7 -0
- package/dist/get-shader-color-from-string.d.ts +3 -0
- package/dist/get-shader-color-from-string.js +101 -0
- package/dist/get-shader-color-from-string.js.map +7 -0
- package/dist/get-shader-color-from-string.test.d.ts +1 -0
- package/dist/get-shader-color-from-string.test.js +69 -0
- package/dist/get-shader-noise-texture.d.ts +1 -0
- package/dist/get-shader-noise-texture.js +18 -0
- package/dist/get-shader-noise-texture.js.map +7 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +194 -0
- package/dist/index.js.map +7 -0
- package/dist/shader-color-spaces.d.ts +6 -0
- package/dist/shader-color-spaces.js +96 -0
- package/dist/shader-color-spaces.js.map +7 -0
- package/dist/shader-mount.d.ts +199 -0
- package/dist/shader-mount.js +735 -0
- package/dist/shader-mount.js.map +7 -0
- package/dist/shader-sizing.d.ts +30 -0
- package/dist/shader-sizing.js +38 -0
- package/dist/shader-sizing.js.map +7 -0
- package/dist/shader-utils.d.ts +10 -0
- package/dist/shader-utils.js +131 -0
- package/dist/shader-utils.js.map +7 -0
- package/dist/shaders/color-panels.d.ts +70 -0
- package/dist/shaders/color-panels.js +224 -0
- package/dist/shaders/color-panels.js.map +7 -0
- package/dist/shaders/dithering.d.ts +62 -0
- package/dist/shaders/dithering.js +271 -0
- package/dist/shaders/dithering.js.map +7 -0
- package/dist/shaders/dot-grid.d.ts +65 -0
- package/dist/shaders/dot-grid.js +110 -0
- package/dist/shaders/dot-grid.js.map +7 -0
- package/dist/shaders/dot-orbit.d.ts +57 -0
- package/dist/shaders/dot-orbit.js +123 -0
- package/dist/shaders/dot-orbit.js.map +7 -0
- package/dist/shaders/fluted-glass.d.ts +112 -0
- package/dist/shaders/fluted-glass.js +361 -0
- package/dist/shaders/fluted-glass.js.map +7 -0
- package/dist/shaders/gem-smoke.d.ts +96 -0
- package/dist/shaders/gem-smoke.js +573 -0
- package/dist/shaders/gem-smoke.js.map +7 -0
- package/dist/shaders/god-rays.d.ts +67 -0
- package/dist/shaders/god-rays.js +133 -0
- package/dist/shaders/god-rays.js.map +7 -0
- package/dist/shaders/grain-gradient.d.ts +80 -0
- package/dist/shaders/grain-gradient.js +301 -0
- package/dist/shaders/grain-gradient.js.map +7 -0
- package/dist/shaders/halftone-cmyk.d.ts +104 -0
- package/dist/shaders/halftone-cmyk.js +295 -0
- package/dist/shaders/halftone-cmyk.js.map +7 -0
- package/dist/shaders/halftone-dots.d.ts +80 -0
- package/dist/shaders/halftone-dots.js +321 -0
- package/dist/shaders/halftone-dots.js.map +7 -0
- package/dist/shaders/heatmap.d.ts +66 -0
- package/dist/shaders/heatmap.js +384 -0
- package/dist/shaders/heatmap.js.map +7 -0
- package/dist/shaders/image-dithering.d.ts +64 -0
- package/dist/shaders/image-dithering.js +199 -0
- package/dist/shaders/image-dithering.js.map +7 -0
- package/dist/shaders/lens-distortion.d.ts +97 -0
- package/dist/shaders/lens-distortion.js +276 -0
- package/dist/shaders/lens-distortion.js.map +7 -0
- package/dist/shaders/liquid-metal.d.ts +89 -0
- package/dist/shaders/liquid-metal.js +633 -0
- package/dist/shaders/liquid-metal.js.map +7 -0
- package/dist/shaders/mesh-gradient.d.ts +52 -0
- package/dist/shaders/mesh-gradient.js +131 -0
- package/dist/shaders/mesh-gradient.js.map +7 -0
- package/dist/shaders/metaballs.d.ts +51 -0
- package/dist/shaders/metaballs.js +111 -0
- package/dist/shaders/metaballs.js.map +7 -0
- package/dist/shaders/neuro-noise.d.ts +47 -0
- package/dist/shaders/neuro-noise.js +77 -0
- package/dist/shaders/neuro-noise.js.map +7 -0
- package/dist/shaders/paper-texture.d.ts +109 -0
- package/dist/shaders/paper-texture.js +527 -0
- package/dist/shaders/paper-texture.js.map +7 -0
- package/dist/shaders/perlin-noise.d.ts +52 -0
- package/dist/shaders/perlin-noise.js +167 -0
- package/dist/shaders/perlin-noise.js.map +7 -0
- package/dist/shaders/pulsing-border.d.ts +98 -0
- package/dist/shaders/pulsing-border.js +239 -0
- package/dist/shaders/pulsing-border.js.map +7 -0
- package/dist/shaders/simplex-noise.d.ts +45 -0
- package/dist/shaders/simplex-noise.js +92 -0
- package/dist/shaders/simplex-noise.js.map +7 -0
- package/dist/shaders/smoke-ring.d.ts +61 -0
- package/dist/shaders/smoke-ring.js +133 -0
- package/dist/shaders/smoke-ring.js.map +7 -0
- package/dist/shaders/spiral.d.ts +61 -0
- package/dist/shaders/spiral.js +83 -0
- package/dist/shaders/spiral.js.map +7 -0
- package/dist/shaders/static-mesh-gradient.d.ts +63 -0
- package/dist/shaders/static-mesh-gradient.js +131 -0
- package/dist/shaders/static-mesh-gradient.js.map +7 -0
- package/dist/shaders/static-radial-gradient.d.ts +72 -0
- package/dist/shaders/static-radial-gradient.js +188 -0
- package/dist/shaders/static-radial-gradient.js.map +7 -0
- package/dist/shaders/swirl.d.ts +63 -0
- package/dist/shaders/swirl.js +104 -0
- package/dist/shaders/swirl.js.map +7 -0
- package/dist/shaders/voronoi.d.ts +65 -0
- package/dist/shaders/voronoi.js +139 -0
- package/dist/shaders/voronoi.js.map +7 -0
- package/dist/shaders/warp.d.ts +70 -0
- package/dist/shaders/warp.js +130 -0
- package/dist/shaders/warp.js.map +7 -0
- package/dist/shaders/water.d.ts +59 -0
- package/dist/shaders/water.js +122 -0
- package/dist/shaders/water.js.map +7 -0
- package/dist/shaders/waves.d.ts +53 -0
- package/dist/shaders/waves.js +66 -0
- package/dist/shaders/waves.js.map +7 -0
- package/dist/shared-webgl-renderer.d.ts +63 -0
- package/dist/shared-webgl-renderer.js +262 -0
- package/dist/shared-webgl-renderer.js.map +7 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +7 -0
- package/dist/vertex-shader.d.ts +2 -0
- package/dist/vertex-shader.js +160 -0
- package/dist/vertex-shader.js.map +7 -0
- package/package.json +29 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
2
|
+
* Paper Shaders *
|
|
3
|
+
* https://github.com/paper-design/shaders *
|
|
4
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
5
|
+
|
|
6
|
+
const vertexShaderSource = `#version 300 es
|
|
7
|
+
precision mediump float;
|
|
8
|
+
|
|
9
|
+
layout(location = 0) in vec4 a_position;
|
|
10
|
+
|
|
11
|
+
uniform vec2 u_resolution;
|
|
12
|
+
uniform float u_pixelRatio;
|
|
13
|
+
uniform float u_imageAspectRatio;
|
|
14
|
+
uniform float u_originX;
|
|
15
|
+
uniform float u_originY;
|
|
16
|
+
uniform float u_worldWidth;
|
|
17
|
+
uniform float u_worldHeight;
|
|
18
|
+
uniform float u_fit;
|
|
19
|
+
uniform float u_scale;
|
|
20
|
+
uniform float u_rotation;
|
|
21
|
+
uniform float u_offsetX;
|
|
22
|
+
uniform float u_offsetY;
|
|
23
|
+
|
|
24
|
+
out vec2 v_objectUV;
|
|
25
|
+
out vec2 v_objectBoxSize;
|
|
26
|
+
out vec2 v_responsiveUV;
|
|
27
|
+
out vec2 v_responsiveBoxGivenSize;
|
|
28
|
+
out vec2 v_patternUV;
|
|
29
|
+
out vec2 v_patternBoxSize;
|
|
30
|
+
out vec2 v_imageUV;
|
|
31
|
+
|
|
32
|
+
vec3 getBoxSize(float boxRatio, vec2 givenBoxSize) {
|
|
33
|
+
vec2 box = vec2(0.);
|
|
34
|
+
// fit = none
|
|
35
|
+
box.x = boxRatio * min(givenBoxSize.x / boxRatio, givenBoxSize.y);
|
|
36
|
+
float noFitBoxWidth = box.x;
|
|
37
|
+
if (u_fit == 1.) { // fit = contain
|
|
38
|
+
box.x = boxRatio * min(u_resolution.x / boxRatio, u_resolution.y);
|
|
39
|
+
} else if (u_fit == 2.) { // fit = cover
|
|
40
|
+
box.x = boxRatio * max(u_resolution.x / boxRatio, u_resolution.y);
|
|
41
|
+
}
|
|
42
|
+
box.y = box.x / boxRatio;
|
|
43
|
+
return vec3(box, noFitBoxWidth);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
void main() {
|
|
47
|
+
gl_Position = a_position;
|
|
48
|
+
|
|
49
|
+
vec2 uv = gl_Position.xy * .5;
|
|
50
|
+
vec2 boxOrigin = vec2(.5 - u_originX, u_originY - .5);
|
|
51
|
+
vec2 givenBoxSize = vec2(u_worldWidth, u_worldHeight);
|
|
52
|
+
givenBoxSize = max(givenBoxSize, vec2(1.)) * u_pixelRatio;
|
|
53
|
+
float r = u_rotation * 3.14159265358979323846 / 180.;
|
|
54
|
+
mat2 graphicRotation = mat2(cos(r), sin(r), -sin(r), cos(r));
|
|
55
|
+
vec2 graphicOffset = vec2(-u_offsetX, u_offsetY);
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
// ===================================================
|
|
59
|
+
|
|
60
|
+
float fixedRatio = 1.;
|
|
61
|
+
vec2 fixedRatioBoxGivenSize = vec2(
|
|
62
|
+
(u_worldWidth == 0.) ? u_resolution.x : givenBoxSize.x,
|
|
63
|
+
(u_worldHeight == 0.) ? u_resolution.y : givenBoxSize.y
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
v_objectBoxSize = getBoxSize(fixedRatio, fixedRatioBoxGivenSize).xy;
|
|
67
|
+
vec2 objectWorldScale = u_resolution.xy / v_objectBoxSize;
|
|
68
|
+
|
|
69
|
+
v_objectUV = uv;
|
|
70
|
+
v_objectUV *= objectWorldScale;
|
|
71
|
+
v_objectUV += boxOrigin * (objectWorldScale - 1.);
|
|
72
|
+
v_objectUV += graphicOffset;
|
|
73
|
+
v_objectUV /= u_scale;
|
|
74
|
+
v_objectUV = graphicRotation * v_objectUV;
|
|
75
|
+
|
|
76
|
+
// ===================================================
|
|
77
|
+
|
|
78
|
+
v_responsiveBoxGivenSize = vec2(
|
|
79
|
+
(u_worldWidth == 0.) ? u_resolution.x : givenBoxSize.x,
|
|
80
|
+
(u_worldHeight == 0.) ? u_resolution.y : givenBoxSize.y
|
|
81
|
+
);
|
|
82
|
+
float responsiveRatio = v_responsiveBoxGivenSize.x / v_responsiveBoxGivenSize.y;
|
|
83
|
+
vec2 responsiveBoxSize = getBoxSize(responsiveRatio, v_responsiveBoxGivenSize).xy;
|
|
84
|
+
vec2 responsiveBoxScale = u_resolution.xy / responsiveBoxSize;
|
|
85
|
+
|
|
86
|
+
#ifdef ADD_HELPERS
|
|
87
|
+
v_responsiveHelperBox = uv;
|
|
88
|
+
v_responsiveHelperBox *= responsiveBoxScale;
|
|
89
|
+
v_responsiveHelperBox += boxOrigin * (responsiveBoxScale - 1.);
|
|
90
|
+
#endif
|
|
91
|
+
|
|
92
|
+
v_responsiveUV = uv;
|
|
93
|
+
v_responsiveUV *= responsiveBoxScale;
|
|
94
|
+
v_responsiveUV += boxOrigin * (responsiveBoxScale - 1.);
|
|
95
|
+
v_responsiveUV += graphicOffset;
|
|
96
|
+
v_responsiveUV /= u_scale;
|
|
97
|
+
v_responsiveUV.x *= responsiveRatio;
|
|
98
|
+
v_responsiveUV = graphicRotation * v_responsiveUV;
|
|
99
|
+
v_responsiveUV.x /= responsiveRatio;
|
|
100
|
+
|
|
101
|
+
// ===================================================
|
|
102
|
+
|
|
103
|
+
float patternBoxRatio = givenBoxSize.x / givenBoxSize.y;
|
|
104
|
+
vec2 patternBoxGivenSize = vec2(
|
|
105
|
+
(u_worldWidth == 0.) ? u_resolution.x : givenBoxSize.x,
|
|
106
|
+
(u_worldHeight == 0.) ? u_resolution.y : givenBoxSize.y
|
|
107
|
+
);
|
|
108
|
+
patternBoxRatio = patternBoxGivenSize.x / patternBoxGivenSize.y;
|
|
109
|
+
|
|
110
|
+
vec3 boxSizeData = getBoxSize(patternBoxRatio, patternBoxGivenSize);
|
|
111
|
+
v_patternBoxSize = boxSizeData.xy;
|
|
112
|
+
float patternBoxNoFitBoxWidth = boxSizeData.z;
|
|
113
|
+
vec2 patternBoxScale = u_resolution.xy / v_patternBoxSize;
|
|
114
|
+
|
|
115
|
+
v_patternUV = uv;
|
|
116
|
+
v_patternUV += graphicOffset / patternBoxScale;
|
|
117
|
+
v_patternUV += boxOrigin;
|
|
118
|
+
v_patternUV -= boxOrigin / patternBoxScale;
|
|
119
|
+
v_patternUV *= u_resolution.xy;
|
|
120
|
+
v_patternUV /= u_pixelRatio;
|
|
121
|
+
if (u_fit > 0.) {
|
|
122
|
+
v_patternUV *= (patternBoxNoFitBoxWidth / v_patternBoxSize.x);
|
|
123
|
+
}
|
|
124
|
+
v_patternUV /= u_scale;
|
|
125
|
+
v_patternUV = graphicRotation * v_patternUV;
|
|
126
|
+
v_patternUV += boxOrigin / patternBoxScale;
|
|
127
|
+
v_patternUV -= boxOrigin;
|
|
128
|
+
// x100 is a default multiplier between vertex and fragmant shaders
|
|
129
|
+
// we use it to avoid UV presision issues
|
|
130
|
+
v_patternUV *= .01;
|
|
131
|
+
|
|
132
|
+
// ===================================================
|
|
133
|
+
|
|
134
|
+
vec2 imageBoxSize;
|
|
135
|
+
if (u_fit == 1.) { // contain
|
|
136
|
+
imageBoxSize.x = min(u_resolution.x / u_imageAspectRatio, u_resolution.y) * u_imageAspectRatio;
|
|
137
|
+
} else if (u_fit == 2.) { // cover
|
|
138
|
+
imageBoxSize.x = max(u_resolution.x / u_imageAspectRatio, u_resolution.y) * u_imageAspectRatio;
|
|
139
|
+
} else {
|
|
140
|
+
imageBoxSize.x = min(10.0, 10.0 / u_imageAspectRatio * u_imageAspectRatio);
|
|
141
|
+
}
|
|
142
|
+
imageBoxSize.y = imageBoxSize.x / u_imageAspectRatio;
|
|
143
|
+
vec2 imageBoxScale = u_resolution.xy / imageBoxSize;
|
|
144
|
+
|
|
145
|
+
v_imageUV = uv;
|
|
146
|
+
v_imageUV *= imageBoxScale;
|
|
147
|
+
v_imageUV += boxOrigin * (imageBoxScale - 1.);
|
|
148
|
+
v_imageUV += graphicOffset;
|
|
149
|
+
v_imageUV /= u_scale;
|
|
150
|
+
v_imageUV.x *= u_imageAspectRatio;
|
|
151
|
+
v_imageUV = graphicRotation * v_imageUV;
|
|
152
|
+
v_imageUV.x /= u_imageAspectRatio;
|
|
153
|
+
|
|
154
|
+
v_imageUV += .5;
|
|
155
|
+
v_imageUV.y = 1. - v_imageUV.y;
|
|
156
|
+
}`;
|
|
157
|
+
export {
|
|
158
|
+
vertexShaderSource
|
|
159
|
+
};
|
|
160
|
+
//# sourceMappingURL=vertex-shader.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/vertex-shader.ts"],
|
|
4
|
+
"sourcesContent": ["/** Vertex shader for the shader mount */\r\n// language=GLSL\r\nexport const vertexShaderSource = `#version 300 es\r\nprecision mediump float;\r\n\r\nlayout(location = 0) in vec4 a_position;\r\n\r\nuniform vec2 u_resolution;\r\nuniform float u_pixelRatio;\r\nuniform float u_imageAspectRatio;\r\nuniform float u_originX;\r\nuniform float u_originY;\r\nuniform float u_worldWidth;\r\nuniform float u_worldHeight;\r\nuniform float u_fit;\r\nuniform float u_scale;\r\nuniform float u_rotation;\r\nuniform float u_offsetX;\r\nuniform float u_offsetY;\r\n\r\nout vec2 v_objectUV;\r\nout vec2 v_objectBoxSize;\r\nout vec2 v_responsiveUV;\r\nout vec2 v_responsiveBoxGivenSize;\r\nout vec2 v_patternUV;\r\nout vec2 v_patternBoxSize;\r\nout vec2 v_imageUV;\r\n\r\nvec3 getBoxSize(float boxRatio, vec2 givenBoxSize) {\r\n vec2 box = vec2(0.);\r\n // fit = none\r\n box.x = boxRatio * min(givenBoxSize.x / boxRatio, givenBoxSize.y);\r\n float noFitBoxWidth = box.x;\r\n if (u_fit == 1.) { // fit = contain\r\n box.x = boxRatio * min(u_resolution.x / boxRatio, u_resolution.y);\r\n } else if (u_fit == 2.) { // fit = cover\r\n box.x = boxRatio * max(u_resolution.x / boxRatio, u_resolution.y);\r\n }\r\n box.y = box.x / boxRatio;\r\n return vec3(box, noFitBoxWidth);\r\n}\r\n\r\nvoid main() {\r\n gl_Position = a_position;\r\n\r\n vec2 uv = gl_Position.xy * .5;\r\n vec2 boxOrigin = vec2(.5 - u_originX, u_originY - .5);\r\n vec2 givenBoxSize = vec2(u_worldWidth, u_worldHeight);\r\n givenBoxSize = max(givenBoxSize, vec2(1.)) * u_pixelRatio;\r\n float r = u_rotation * 3.14159265358979323846 / 180.;\r\n mat2 graphicRotation = mat2(cos(r), sin(r), -sin(r), cos(r));\r\n vec2 graphicOffset = vec2(-u_offsetX, u_offsetY);\r\n\r\n\r\n // ===================================================\r\n\r\n float fixedRatio = 1.;\r\n vec2 fixedRatioBoxGivenSize = vec2(\r\n (u_worldWidth == 0.) ? u_resolution.x : givenBoxSize.x,\r\n (u_worldHeight == 0.) ? u_resolution.y : givenBoxSize.y\r\n );\r\n\r\n v_objectBoxSize = getBoxSize(fixedRatio, fixedRatioBoxGivenSize).xy;\r\n vec2 objectWorldScale = u_resolution.xy / v_objectBoxSize;\r\n\r\n v_objectUV = uv;\r\n v_objectUV *= objectWorldScale;\r\n v_objectUV += boxOrigin * (objectWorldScale - 1.);\r\n v_objectUV += graphicOffset;\r\n v_objectUV /= u_scale;\r\n v_objectUV = graphicRotation * v_objectUV;\r\n\r\n // ===================================================\r\n\r\n v_responsiveBoxGivenSize = vec2(\r\n (u_worldWidth == 0.) ? u_resolution.x : givenBoxSize.x,\r\n (u_worldHeight == 0.) ? u_resolution.y : givenBoxSize.y\r\n );\r\n float responsiveRatio = v_responsiveBoxGivenSize.x / v_responsiveBoxGivenSize.y;\r\n vec2 responsiveBoxSize = getBoxSize(responsiveRatio, v_responsiveBoxGivenSize).xy;\r\n vec2 responsiveBoxScale = u_resolution.xy / responsiveBoxSize;\r\n\r\n #ifdef ADD_HELPERS\r\n v_responsiveHelperBox = uv;\r\n v_responsiveHelperBox *= responsiveBoxScale;\r\n v_responsiveHelperBox += boxOrigin * (responsiveBoxScale - 1.);\r\n #endif\r\n\r\n v_responsiveUV = uv;\r\n v_responsiveUV *= responsiveBoxScale;\r\n v_responsiveUV += boxOrigin * (responsiveBoxScale - 1.);\r\n v_responsiveUV += graphicOffset;\r\n v_responsiveUV /= u_scale;\r\n v_responsiveUV.x *= responsiveRatio;\r\n v_responsiveUV = graphicRotation * v_responsiveUV;\r\n v_responsiveUV.x /= responsiveRatio;\r\n\r\n // ===================================================\r\n\r\n float patternBoxRatio = givenBoxSize.x / givenBoxSize.y;\r\n vec2 patternBoxGivenSize = vec2(\r\n (u_worldWidth == 0.) ? u_resolution.x : givenBoxSize.x,\r\n (u_worldHeight == 0.) ? u_resolution.y : givenBoxSize.y\r\n );\r\n patternBoxRatio = patternBoxGivenSize.x / patternBoxGivenSize.y;\r\n\r\n vec3 boxSizeData = getBoxSize(patternBoxRatio, patternBoxGivenSize);\r\n v_patternBoxSize = boxSizeData.xy;\r\n float patternBoxNoFitBoxWidth = boxSizeData.z;\r\n vec2 patternBoxScale = u_resolution.xy / v_patternBoxSize;\r\n\r\n v_patternUV = uv;\r\n v_patternUV += graphicOffset / patternBoxScale;\r\n v_patternUV += boxOrigin;\r\n v_patternUV -= boxOrigin / patternBoxScale;\r\n v_patternUV *= u_resolution.xy;\r\n v_patternUV /= u_pixelRatio;\r\n if (u_fit > 0.) {\r\n v_patternUV *= (patternBoxNoFitBoxWidth / v_patternBoxSize.x);\r\n }\r\n v_patternUV /= u_scale;\r\n v_patternUV = graphicRotation * v_patternUV;\r\n v_patternUV += boxOrigin / patternBoxScale;\r\n v_patternUV -= boxOrigin;\r\n // x100 is a default multiplier between vertex and fragmant shaders\r\n // we use it to avoid UV presision issues\r\n v_patternUV *= .01;\r\n\r\n // ===================================================\r\n\r\n vec2 imageBoxSize;\r\n if (u_fit == 1.) { // contain\r\n imageBoxSize.x = min(u_resolution.x / u_imageAspectRatio, u_resolution.y) * u_imageAspectRatio;\r\n } else if (u_fit == 2.) { // cover\r\n imageBoxSize.x = max(u_resolution.x / u_imageAspectRatio, u_resolution.y) * u_imageAspectRatio;\r\n } else {\r\n imageBoxSize.x = min(10.0, 10.0 / u_imageAspectRatio * u_imageAspectRatio);\r\n }\r\n imageBoxSize.y = imageBoxSize.x / u_imageAspectRatio;\r\n vec2 imageBoxScale = u_resolution.xy / imageBoxSize;\r\n\r\n v_imageUV = uv;\r\n v_imageUV *= imageBoxScale;\r\n v_imageUV += boxOrigin * (imageBoxScale - 1.);\r\n v_imageUV += graphicOffset;\r\n v_imageUV /= u_scale;\r\n v_imageUV.x *= u_imageAspectRatio;\r\n v_imageUV = graphicRotation * v_imageUV;\r\n v_imageUV.x /= u_imageAspectRatio;\r\n\r\n v_imageUV += .5;\r\n v_imageUV.y = 1. - v_imageUV.y;\r\n}`;\r\n"],
|
|
5
|
+
"mappings": ";;;;;AAEO,MAAM,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "shaders-oneshot",
|
|
3
|
+
"version": "0.0.81-shared.1",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"module": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"NOTICE"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"type-check": "tsc --project tsconfig.json"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {}
|
|
29
|
+
}
|