@lightningjs/renderer 2.13.2 → 2.13.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.
Files changed (41) hide show
  1. package/dist/src/core/CoreTextureManager.js +6 -0
  2. package/dist/src/core/CoreTextureManager.js.map +1 -1
  3. package/dist/src/core/platforms/Platform.d.ts +37 -0
  4. package/dist/src/core/platforms/Platform.js +22 -0
  5. package/dist/src/core/platforms/Platform.js.map +1 -0
  6. package/dist/src/core/platforms/web/WebPlatform.d.ts +9 -0
  7. package/dist/src/core/platforms/web/WebPlatform.js +58 -0
  8. package/dist/src/core/platforms/web/WebPlatform.js.map +1 -0
  9. package/dist/src/core/renderers/CoreShaderNode.d.ts +2 -3
  10. package/dist/src/core/renderers/CoreShaderNode.js +0 -3
  11. package/dist/src/core/renderers/CoreShaderNode.js.map +1 -1
  12. package/dist/src/core/renderers/canvas/CanvasRenderer.js.map +1 -1
  13. package/dist/src/core/renderers/canvas/CanvasTexture.js +3 -2
  14. package/dist/src/core/renderers/canvas/CanvasTexture.js.map +1 -1
  15. package/dist/src/core/renderers/webgl/WebGlRenderOp.d.ts +10 -2
  16. package/dist/src/core/renderers/webgl/WebGlRenderOp.js +27 -16
  17. package/dist/src/core/renderers/webgl/WebGlRenderOp.js.map +1 -1
  18. package/dist/src/core/renderers/webgl/WebGlRenderer.d.ts +4 -3
  19. package/dist/src/core/renderers/webgl/WebGlRenderer.js +101 -76
  20. package/dist/src/core/renderers/webgl/WebGlRenderer.js.map +1 -1
  21. package/dist/src/core/renderers/webgl/WebGlShaderNode.d.ts +2 -1
  22. package/dist/src/core/renderers/webgl/WebGlShaderNode.js.map +1 -1
  23. package/dist/src/core/renderers/webgl/WebGlShaderProgram.d.ts +1 -1
  24. package/dist/src/core/renderers/webgl/WebGlShaderProgram.js +32 -26
  25. package/dist/src/core/renderers/webgl/WebGlShaderProgram.js.map +1 -1
  26. package/dist/src/core/shaders/canvas/RoundedWithBorder.js +8 -2
  27. package/dist/src/core/shaders/canvas/RoundedWithBorder.js.map +1 -1
  28. package/dist/src/core/shaders/webgl/Border.js +57 -34
  29. package/dist/src/core/shaders/webgl/Border.js.map +1 -1
  30. package/dist/src/core/shaders/webgl/RoundedWithBorder.js +69 -37
  31. package/dist/src/core/shaders/webgl/RoundedWithBorder.js.map +1 -1
  32. package/dist/src/core/shaders/webgl/RoundedWithBorderAndShadow.js +78 -41
  33. package/dist/src/core/shaders/webgl/RoundedWithBorderAndShadow.js.map +1 -1
  34. package/dist/src/core/shaders/webgl/SdfShader.js +1 -1
  35. package/dist/src/core/shaders/webgl/SdfShader.js.map +1 -1
  36. package/dist/src/core/temp.d.ts +1 -0
  37. package/dist/src/core/temp.js +77 -0
  38. package/dist/src/core/temp.js.map +1 -0
  39. package/dist/tsconfig.dist.tsbuildinfo +1 -1
  40. package/package.json +1 -1
  41. package/src/core/CoreTextureManager.ts +7 -0
@@ -18,11 +18,51 @@ import { valuesAreEqual } from '../../lib/utils.js';
18
18
  import { BorderTemplate, } from '../templates/BorderTemplate.js';
19
19
  export const Border = {
20
20
  props: BorderTemplate.props,
21
- update() {
22
- this.uniform4fa('u_width', this.props.width);
23
- this.uniform1i('u_asymWidth', valuesAreEqual(this.props.width) ? 0 : 1);
24
- this.uniformRGBA('u_color', this.props.color);
21
+ update(node) {
22
+ this.uniform4fa('u_borderWidth', this.props.width);
23
+ this.uniformRGBA('u_borderColor', this.props.color);
25
24
  },
25
+ vertex: `
26
+ # ifdef GL_FRAGMENT_PRECISION_HIGH
27
+ precision highp float;
28
+ # else
29
+ precision mediump float;
30
+ # endif
31
+
32
+ attribute vec2 a_position;
33
+ attribute vec2 a_textureCoords;
34
+ attribute vec4 a_color;
35
+ attribute vec2 a_nodeCoords;
36
+
37
+ uniform vec2 u_resolution;
38
+ uniform float u_pixelRatio;
39
+ uniform vec2 u_dimensions;
40
+
41
+ uniform vec4 u_radius;
42
+ uniform vec4 u_borderWidth;
43
+
44
+ varying vec4 v_color;
45
+ varying vec2 v_textureCoords;
46
+ varying vec2 v_nodeCoords;
47
+
48
+ varying vec2 v_innerSize;
49
+ varying vec2 v_halfDimensions;
50
+
51
+ void main() {
52
+ vec2 normalized = a_position * u_pixelRatio;
53
+ vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);
54
+
55
+ v_color = a_color;
56
+ v_nodeCoords = a_nodeCoords;
57
+ v_textureCoords = a_textureCoords;
58
+
59
+ v_halfDimensions = u_dimensions * 0.5;
60
+ v_innerSize = vec2(u_dimensions.x - (u_borderWidth[3] + u_borderWidth[1]), u_dimensions.y - (u_borderWidth[0] + u_borderWidth[2])) * 0.5 - 0.5;
61
+
62
+ gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);
63
+ gl_Position.y = -sign(screenSpace.y) * gl_Position.y;
64
+ }
65
+ `,
26
66
  fragment: `
27
67
  # ifdef GL_FRAGMENT_PRECISION_HIGH
28
68
  precision highp float;
@@ -37,49 +77,32 @@ export const Border = {
37
77
  uniform vec2 u_dimensions;
38
78
  uniform sampler2D u_texture;
39
79
 
40
- uniform vec4 u_width;
41
- uniform vec4 u_color;
42
-
43
- uniform int u_asymWidth;
80
+ uniform vec4 u_borderWidth;
81
+ uniform vec4 u_borderColor;
44
82
 
45
83
  varying vec4 v_color;
46
- varying vec2 v_position;
84
+ varying vec2 v_nodeCoords;
47
85
  varying vec2 v_textureCoords;
48
86
 
87
+ varying vec2 v_innerSize;
88
+ varying vec2 v_halfDimensions;
89
+
49
90
  float box(vec2 p, vec2 s) {
50
- vec2 q = abs(p) - (s - (4.0 - u_pixelRatio));
91
+ vec2 q = abs(p) - s;
51
92
  return (min(max(q.x, q.y), 0.0) + length(max(q, 0.0)));
52
93
  }
53
94
 
54
- float asymBorderWidth(vec2 p, float d, vec4 w) {
55
- p.x += w.y > w.w ? (w.y - w.w) * 0.5 : -(w.w - w.y) * 0.5;
56
- p.y += w.z > w.x ? (w.z - w.x) * 0.5 : -(w.x - w.z) * 0.5;
57
-
58
- vec2 size = vec2(u_dimensions.x - (w[3] + w[1]), u_dimensions.y - (w[0] + w[2])) * 0.5;
59
- float borderDist = box(p, size + 2.0);
60
- return 1.0 - smoothstep(0.0, u_pixelRatio, max(-borderDist, d));
61
- }
62
-
63
95
  void main() {
64
96
  vec4 color = texture2D(u_texture, v_textureCoords) * v_color;
65
- vec2 halfDimensions = (u_dimensions * 0.5);
66
-
67
- vec2 boxUv = v_textureCoords.xy * u_dimensions - halfDimensions;
68
- float boxDist = box(boxUv, halfDimensions);
97
+ vec2 boxUv = v_nodeCoords.xy * u_dimensions - v_halfDimensions;
69
98
 
70
- float boxAlpha = 1.0 - smoothstep(0.0, u_pixelRatio, boxDist);
71
- float borderAlpha = 0.0;
99
+ boxUv.x += u_borderWidth.y > u_borderWidth.w ? (u_borderWidth.y - u_borderWidth.w) * 0.5 : -(u_borderWidth.w - u_borderWidth.y) * 0.5;
100
+ boxUv.y += u_borderWidth.z > u_borderWidth.x ? (u_borderWidth.z - u_borderWidth.x) * 0.5 : -(u_borderWidth.x - u_borderWidth.z) * 0.5;
72
101
 
73
- if(u_asymWidth == 1) {
74
- borderAlpha = asymBorderWidth(boxUv, boxDist, u_width);
75
- }
76
- else {
77
- borderAlpha = 1.0 - smoothstep(u_width[0], u_width[0], abs(boxDist));
78
- }
102
+ float innerDist = box(boxUv, v_innerSize);
103
+ float innerAlpha = 1.0 - smoothstep(0.0, 1.0, innerDist);
79
104
 
80
- vec4 resColor = vec4(0.0);
81
- resColor = mix(resColor, color, min(color.a, boxAlpha));
82
- resColor = mix(resColor, u_color, min(u_color.a, min(borderAlpha, boxAlpha)));
105
+ vec4 resColor = mix(u_borderColor, color, innerAlpha);
83
106
  gl_FragColor = resColor * u_alpha;
84
107
  }
85
108
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"Border.js","sourceRoot":"","sources":["../../../../../src/core/shaders/webgl/Border.ts"],"names":[],"mappings":"AAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CT;CACF,CAAC"}
@@ -14,18 +14,65 @@
14
14
  *
15
15
  * SPDX-License-Identifier: Apache-2.0
16
16
  */
17
- import { calcFactoredRadiusArray, valuesAreEqual } from '../../lib/utils.js';
17
+ import { calcFactoredRadiusArray } from '../../lib/utils.js';
18
18
  import { RoundedWithBorderTemplate, } from '../templates/RoundedWithBorderTemplate.js';
19
- import { Rounded } from './Rounded.js';
20
19
  export const RoundedWithBorder = {
21
20
  props: RoundedWithBorderTemplate.props,
22
21
  update(node) {
23
- this.uniformRGBA('u_border_color', this.props['border-color']);
24
- this.uniform4fa('u_border_width', this.props['border-width']);
25
- this.uniform1i('u_border_asym', valuesAreEqual(this.props['border-width']) ? 0 : 1);
22
+ this.uniformRGBA('u_borderColor', this.props['border-color']);
23
+ this.uniform4fa('u_borderWidth', this.props['border-width']);
26
24
  this.uniform4fa('u_radius', calcFactoredRadiusArray(this.props.radius, node.width, node.height));
27
25
  },
28
- vertex: Rounded.vertex,
26
+ vertex: `
27
+ # ifdef GL_FRAGMENT_PRECISION_HIGH
28
+ precision highp float;
29
+ # else
30
+ precision mediump float;
31
+ # endif
32
+
33
+ attribute vec2 a_position;
34
+ attribute vec2 a_textureCoords;
35
+ attribute vec4 a_color;
36
+ attribute vec2 a_nodeCoords;
37
+
38
+ uniform vec2 u_resolution;
39
+ uniform float u_pixelRatio;
40
+ uniform vec2 u_dimensions;
41
+
42
+ uniform vec4 u_radius;
43
+ uniform vec4 u_borderWidth;
44
+
45
+ varying vec4 v_color;
46
+ varying vec2 v_textureCoords;
47
+ varying vec2 v_nodeCoords;
48
+
49
+ varying vec4 v_innerRadius;
50
+ varying vec2 v_innerSize;
51
+ varying vec2 v_halfDimensions;
52
+
53
+ void main() {
54
+ vec2 normalized = a_position * u_pixelRatio;
55
+ vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);
56
+
57
+ v_color = a_color;
58
+ v_nodeCoords = a_nodeCoords;
59
+ v_textureCoords = a_textureCoords;
60
+
61
+ v_halfDimensions = u_dimensions * 0.5;
62
+
63
+ v_innerRadius = vec4(
64
+ max(0.0, u_radius.x - max(u_borderWidth.x, u_borderWidth.w) - 0.5),
65
+ max(0.0, u_radius.y - max(u_borderWidth.x, u_borderWidth.y) - 0.5),
66
+ max(0.0, u_radius.z - max(u_borderWidth.z, u_borderWidth.y) - 0.5),
67
+ max(0.0, u_radius.w - max(u_borderWidth.z, u_borderWidth.w) - 0.5)
68
+ );
69
+
70
+ v_innerSize = (vec2(u_dimensions.x - (u_borderWidth[3] + u_borderWidth[1]) + 1.0, u_dimensions.y - (u_borderWidth[0] + u_borderWidth[2])) - 2.0) * 0.5;
71
+
72
+ gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);
73
+ gl_Position.y = -sign(screenSpace.y) * gl_Position.y;
74
+ }
75
+ `,
29
76
  fragment: `
30
77
  # ifdef GL_FRAGMENT_PRECISION_HIGH
31
78
  precision highp float;
@@ -41,14 +88,17 @@ export const RoundedWithBorder = {
41
88
 
42
89
  uniform vec4 u_radius;
43
90
 
44
- uniform vec4 u_border_width;
45
- uniform vec4 u_border_color;
46
- uniform int u_border_asym;
91
+ uniform vec4 u_borderWidth;
92
+ uniform vec4 u_borderColor;
47
93
 
48
94
  varying vec4 v_color;
49
95
  varying vec2 v_textureCoords;
50
96
  varying vec2 v_nodeCoords;
51
97
 
98
+ varying vec2 v_halfDimensions;
99
+ varying vec4 v_innerRadius;
100
+ varying vec2 v_innerSize;
101
+
52
102
  float roundedBox(vec2 p, vec2 s, vec4 r) {
53
103
  r.xy = (p.x > 0.0) ? r.yz : r.xw;
54
104
  r.x = (p.y > 0.0) ? r.y : r.x;
@@ -56,40 +106,22 @@ export const RoundedWithBorder = {
56
106
  return (min(max(q.x, q.y), 0.0) + length(max(q, 0.0))) - r.x;
57
107
  }
58
108
 
59
- float asymBorderWidth(vec2 p, float d, vec4 r, vec4 w) {
60
- r.x = (r.x - (max(w.w, w.x) - min(w.w, w.x))) * 0.5;
61
- r.y = (r.y - (max(w.y, w.x) - min(w.y, w.x))) * 0.5;
62
- r.z = (r.z - (max(w.y, w.z) - min(w.y, w.z))) * 0.5;
63
- r.w = (r.w - (max(w.w, w.z) - min(w.w, w.z))) * 0.5;
64
-
65
- p.x += w.y > w.w ? (w.y - w.w) * 0.5 : -(w.w - w.y) * 0.5;
66
- p.y += w.z > w.x ? (w.z - w.x) * 0.5 : -(w.x - w.z) * 0.5;
67
-
68
- vec2 size = vec2(u_dimensions.x - (w[3] + w[1]), u_dimensions.y - (w[0] + w[2])) * 0.5;
69
- float borderDist = roundedBox(p, size + u_pixelRatio, r);
70
- return 1.0 - smoothstep(0.0, u_pixelRatio, max(-borderDist, d));
71
- }
72
-
73
109
  void main() {
74
110
  vec4 color = texture2D(u_texture, v_textureCoords) * v_color;
75
- vec2 halfDimensions = (u_dimensions * 0.5);
76
111
 
77
- vec2 boxUv = v_nodeCoords.xy * u_dimensions - halfDimensions;
78
- float boxDist = roundedBox(boxUv, halfDimensions, u_radius);
112
+ vec2 boxUv = v_nodeCoords.xy * u_dimensions - v_halfDimensions;
113
+ float outerDist = roundedBox(boxUv, v_halfDimensions, u_radius);
114
+
115
+ float outerAlpha = 1.0 - smoothstep(0.0, 1.0, outerDist);
79
116
 
80
- float roundedAlpha = 1.0 - smoothstep(0.0, u_pixelRatio, boxDist);
81
- float borderAlpha = 0.0;
117
+ boxUv.x += u_borderWidth.y > u_borderWidth.w ? (u_borderWidth.y - u_borderWidth.w) * 0.5 : -(u_borderWidth.w - u_borderWidth.y) * 0.5;
118
+ boxUv.y += u_borderWidth.z > u_borderWidth.x ? ((u_borderWidth.z - u_borderWidth.x) * 0.5 + 0.5) : -(u_borderWidth.x - u_borderWidth.z) * 0.5;
82
119
 
83
- if(u_border_asym == 1) {
84
- borderAlpha = asymBorderWidth(boxUv, boxDist, u_radius, u_border_width);
85
- }
86
- else {
87
- borderAlpha = 1.0 - smoothstep(u_border_width[0] - u_pixelRatio, u_border_width[0], abs(boxDist));
88
- }
120
+ float innerDist = roundedBox(boxUv, v_innerSize, v_innerRadius);
121
+ float innerAlpha = 1.0 - smoothstep(0.0, 1.0, innerDist);
89
122
 
90
- vec4 resColor = vec4(0.0);
91
- resColor = mix(resColor, color, min(color.a, roundedAlpha));
92
- resColor = mix(resColor, u_border_color, min(u_border_color.a, min(borderAlpha, roundedAlpha)));
123
+ vec4 resColor = mix(u_borderColor, color, innerAlpha);
124
+ resColor = mix(vec4(0.0), resColor, outerAlpha);
93
125
  gl_FragColor = resColor * u_alpha;
94
126
  }
95
127
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"RoundedWithBorder.js","sourceRoot":"","sources":["../../../../../src/core/shaders/webgl/RoundedWithBorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAG7E,OAAO,EACL,yBAAyB,GAE1B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,CAAC,MAAM,iBAAiB,GAA4C;IACxE,KAAK,EAAE,yBAAyB,CAAC,KAAK;IACtC,MAAM,CAAC,IAAc;QACnB,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,IAAI,CAAC,KAAM,CAAC,cAAc,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,IAAI,CAAC,KAAM,CAAC,cAAc,CAAS,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS,CACZ,eAAe,EACf,cAAc,CAAC,IAAI,CAAC,KAAM,CAAC,cAAc,CAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAChE,CAAC;QACF,IAAI,CAAC,UAAU,CACb,UAAU,EACV,uBAAuB,CACrB,IAAI,CAAC,KAAM,CAAC,MAAc,EAC1B,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,CACZ,CACF,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkET;CACF,CAAC"}
1
+ {"version":3,"file":"RoundedWithBorder.js","sourceRoot":"","sources":["../../../../../src/core/shaders/webgl/RoundedWithBorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EACL,yBAAyB,GAE1B,MAAM,2CAA2C,CAAC;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAA4C;IACxE,KAAK,EAAE,yBAAyB,CAAC,KAAK;IACtC,MAAM,CAAC,IAAc;QACnB,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,IAAI,CAAC,KAAM,CAAC,cAAc,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,IAAI,CAAC,KAAM,CAAC,cAAc,CAAS,CAAC,CAAC;QAEtE,IAAI,CAAC,UAAU,CACb,UAAU,EACV,uBAAuB,CACrB,IAAI,CAAC,KAAM,CAAC,MAAc,EAC1B,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,CACZ,CACF,CAAC;IACJ,CAAC;IACD,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDP;IACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDT;CACF,CAAC"}
@@ -14,20 +14,72 @@
14
14
  *
15
15
  * SPDX-License-Identifier: Apache-2.0
16
16
  */
17
- import { calcFactoredRadiusArray, valuesAreEqual } from '../../lib/utils.js';
17
+ import { calcFactoredRadiusArray } from '../../lib/utils.js';
18
18
  import { RoundedWithBorderAndShadowTemplate, } from '../templates/RoundedWithBorderAndShadowTemplate.js';
19
- import { Shadow } from './Shadow.js';
20
19
  export const RoundedWithBorderAndShadow = {
21
20
  props: RoundedWithBorderAndShadowTemplate.props,
22
21
  update(node) {
23
- this.uniformRGBA('u_border_color', this.props['border-color']);
24
- this.uniform4fa('u_border_width', this.props['border-width']);
25
- this.uniform1i('u_border_asym', valuesAreEqual(this.props['border-width']) ? 0 : 1);
26
- this.uniformRGBA('u_shadow_color', this.props['shadow-color']);
22
+ this.uniformRGBA('u_borderColor', this.props['border-color']);
23
+ this.uniform4fa('u_borderWidth', this.props['border-width']);
24
+ this.uniformRGBA('u_shadowColor', this.props['shadow-color']);
27
25
  this.uniform4fa('u_shadow', this.props['shadow-projection']);
28
26
  this.uniform4fa('u_radius', calcFactoredRadiusArray(this.props.radius, node.width, node.height));
29
27
  },
30
- vertex: Shadow.vertex,
28
+ vertex: `
29
+ # ifdef GL_FRAGMENT_PRECISION_HIGH
30
+ precision highp float;
31
+ # else
32
+ precision mediump float;
33
+ # endif
34
+
35
+ attribute vec2 a_position;
36
+ attribute vec2 a_textureCoords;
37
+ attribute vec4 a_color;
38
+ attribute vec2 a_nodeCoords;
39
+
40
+ uniform vec2 u_resolution;
41
+ uniform float u_pixelRatio;
42
+ uniform float u_rtt;
43
+ uniform vec2 u_dimensions;
44
+
45
+ uniform vec4 u_shadow;
46
+ uniform vec4 u_radius;
47
+ uniform vec4 u_borderWidth;
48
+
49
+ varying vec4 v_color;
50
+ varying vec2 v_textureCoords;
51
+ varying vec2 v_nodeCoords;
52
+
53
+ varying vec4 v_innerRadius;
54
+ varying vec2 v_innerSize;
55
+ varying vec2 v_halfDimensions;
56
+
57
+ void main() {
58
+ vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);
59
+ vec2 outerEdge = clamp(a_nodeCoords * 2.0 - vec2(1.0), -1.0, 1.0);
60
+
61
+ vec2 shadowEdge = outerEdge * ((u_shadow.w * 2.0)+ u_shadow.z) + u_shadow.xy;
62
+ vec2 normVertexPos = a_position * u_pixelRatio;
63
+
64
+ vec2 vertexPos = (a_position + outerEdge + shadowEdge) * u_pixelRatio;
65
+ gl_Position = vec4(vertexPos.x * screenSpace.x - 1.0, -sign(screenSpace.y) * (vertexPos.y * -abs(screenSpace.y)) + 1.0, 0.0, 1.0);
66
+
67
+ v_halfDimensions = u_dimensions * 0.5;
68
+
69
+ v_innerRadius = vec4(
70
+ max(0.0, u_radius.x - max(u_borderWidth.x, u_borderWidth.w) - 0.5),
71
+ max(0.0, u_radius.y - max(u_borderWidth.x, u_borderWidth.y) - 0.5),
72
+ max(0.0, u_radius.z - max(u_borderWidth.z, u_borderWidth.y) - 0.5),
73
+ max(0.0, u_radius.w - max(u_borderWidth.z, u_borderWidth.w) - 0.5)
74
+ );
75
+
76
+ v_innerSize = (vec2(u_dimensions.x - (u_borderWidth[3] + u_borderWidth[1]) - 1.0, u_dimensions.y - (u_borderWidth[0] + u_borderWidth[2])) - 2.0) * 0.5;
77
+
78
+ v_color = a_color;
79
+ v_nodeCoords = a_nodeCoords + (screenSpace + shadowEdge) / (u_dimensions);
80
+ v_textureCoords = a_textureCoords + (screenSpace + shadowEdge) / (u_dimensions);
81
+ }
82
+ `,
31
83
  fragment: `
32
84
  # ifdef GL_FRAGMENT_PRECISION_HIGH
33
85
  precision highp float;
@@ -43,16 +95,19 @@ export const RoundedWithBorderAndShadow = {
43
95
  uniform float u_rtt;
44
96
 
45
97
  uniform vec4 u_radius;
46
- uniform vec4 u_border_width;
47
- uniform vec4 u_border_color;
48
- uniform int u_border_asym;
49
- uniform vec4 u_shadow_color;
98
+ uniform vec4 u_borderWidth;
99
+ uniform vec4 u_borderColor;
100
+ uniform vec4 u_shadowColor;
50
101
  uniform vec4 u_shadow;
51
102
 
52
103
  varying vec4 v_color;
53
104
  varying vec2 v_textureCoords;
54
105
  varying vec2 v_nodeCoords;
55
106
 
107
+ varying vec2 v_halfDimensions;
108
+ varying vec4 v_innerRadius;
109
+ varying vec2 v_innerSize;
110
+
56
111
  float roundedBox(vec2 p, vec2 s, vec4 r) {
57
112
  r.xy = (p.x > 0.0) ? r.yz : r.xw;
58
113
  r.x = (p.y > 0.0) ? r.y : r.x;
@@ -60,20 +115,6 @@ export const RoundedWithBorderAndShadow = {
60
115
  return (min(max(q.x, q.y), 0.0) + length(max(q, 0.0))) - r.x;
61
116
  }
62
117
 
63
- float asymBorderWidth(vec2 p, float d, vec4 r, vec4 w) {
64
- r.x = (r.x - (max(w.w, w.x) - min(w.w, w.x))) * 0.5;
65
- r.y = (r.y - (max(w.y, w.x) - min(w.y, w.x))) * 0.5;
66
- r.z = (r.z - (max(w.y, w.z) - min(w.y, w.z))) * 0.5;
67
- r.w = (r.w - (max(w.w, w.z) - min(w.w, w.z))) * 0.5;
68
-
69
- p.x += w.y > w.w ? (w.y - w.w) * 0.5 : -(w.w - w.y) * 0.5;
70
- p.y += w.z > w.x ? (w.z - w.x) * 0.5 : -(w.x - w.z) * 0.5;
71
-
72
- vec2 size = vec2(u_dimensions.x - (w[3] + w[1]), u_dimensions.y - (w[0] + w[2])) * 0.5;
73
- float borderDist = roundedBox(p, size, r);
74
- return 1.0 - smoothstep(0.0, u_pixelRatio, max(-borderDist, d));
75
- }
76
-
77
118
  float shadowBox(vec2 p, vec2 s, vec4 r) {
78
119
  r.xy = (p.x > 0.0) ? r.yz : r.xw;
79
120
  r.x = (p.y > 0.0) ? r.y : r.x;
@@ -84,27 +125,23 @@ export const RoundedWithBorderAndShadow = {
84
125
 
85
126
  void main() {
86
127
  vec4 color = texture2D(u_texture, v_textureCoords) * v_color;
87
- vec2 halfDimensions = (u_dimensions * 0.5);
88
128
 
89
- vec2 boxUv = v_nodeCoords.xy * u_dimensions - halfDimensions;
90
- float outerBoxDist = roundedBox(boxUv, halfDimensions, u_radius);
129
+ vec2 boxUv = v_nodeCoords.xy * u_dimensions - v_halfDimensions;
130
+ float outerDist = roundedBox(boxUv, v_halfDimensions - 1.0, u_radius);
131
+
132
+ float outerAlpha = 1.0 - smoothstep(0.0, 1.0, outerDist);
91
133
 
92
- float roundedAlpha = 1.0 - smoothstep(0.0, u_pixelRatio, outerBoxDist);
93
- float borderAlpha = 0.0;
134
+ boxUv.x += u_borderWidth.y > u_borderWidth.w ? (u_borderWidth.y - u_borderWidth.w) * 0.5 : -(u_borderWidth.w - u_borderWidth.y) * 0.5;
135
+ boxUv.y += u_borderWidth.z > u_borderWidth.x ? ((u_borderWidth.z - u_borderWidth.x) * 0.5 + 0.5) : -(u_borderWidth.x - u_borderWidth.z) * 0.5;
94
136
 
95
- if(u_border_asym == 1) {
96
- borderAlpha = asymBorderWidth(boxUv, outerBoxDist, u_radius, u_border_width);
97
- }
98
- else {
99
- borderAlpha = 1.0 - smoothstep(u_border_width[0], u_border_width[0], abs(outerBoxDist));
100
- }
137
+ float innerDist = roundedBox(boxUv, v_innerSize, v_innerRadius);
138
+ float innerAlpha = 1.0 - smoothstep(0.0, 1.0, innerDist);
101
139
 
102
- float shadowAlpha = shadowBox(boxUv - u_shadow.xy, halfDimensions + u_shadow.w, u_radius + u_shadow.z);
140
+ float shadowAlpha = shadowBox(boxUv - u_shadow.xy, v_halfDimensions + u_shadow.w, u_radius + u_shadow.z);
103
141
 
104
- vec4 resColor = vec4(0.0);
105
- resColor = mix(resColor, u_shadow_color, shadowAlpha);
106
- resColor = mix(resColor, color, min(color.a, roundedAlpha));
107
- resColor = mix(resColor, u_border_color, min(u_border_color.a, min(borderAlpha, roundedAlpha)));
142
+ vec4 shadow = mix(vec4(0.0), u_shadowColor, shadowAlpha);
143
+ vec4 resColor = mix(u_borderColor, color, innerAlpha);
144
+ resColor = mix(shadow, resColor, outerAlpha);
108
145
  gl_FragColor = resColor * u_alpha;
109
146
  }
110
147
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"RoundedWithBorderAndShadow.js","sourceRoot":"","sources":["../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oundedWithBorderAndShadow.js","sourceRoot":"","sources":["../../../../../src/core/shaders/webgl/RoundedWithBorderAndShadow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EACL,kCAAkC,GAEnC,MAAM,oDAAoD,CAAC;AAE5D,MAAM,CAAC,MAAM,0BAA0B,GACrC;IACE,KAAK,EAAE,kCAAkC,CAAC,KAAK;IAC/C,MAAM,CAAC,IAAc;QACnB,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,IAAI,CAAC,KAAM,CAAC,cAAc,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,IAAI,CAAC,KAAM,CAAC,cAAc,CAAS,CAAC,CAAC;QAEtE,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,IAAI,CAAC,KAAM,CAAC,cAAc,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,KAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAE9D,IAAI,CAAC,UAAU,CACb,UAAU,EACV,uBAAuB,CACrB,IAAI,CAAC,KAAM,CAAC,MAAc,EAC1B,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,CACZ,CACF,CAAC;IACJ,CAAC;IACD,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDT;IACC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEX;CACA,CAAC"}
@@ -43,7 +43,7 @@ export const Sdf = {
43
43
  onSdfBind(props) {
44
44
  this.uniformMatrix3fv('u_transform', props.transform);
45
45
  this.uniform1f('u_scrollY', props.scrollY);
46
- this.uniform4fv('u_color', new Float32Array(getNormalizedRgbaComponents(props.color)));
46
+ this.uniform4fa('u_color', getNormalizedRgbaComponents(props.color));
47
47
  this.uniform1f('u_size', props.size);
48
48
  this.uniform1f('u_distanceRange', props.distanceRange);
49
49
  this.uniform1i('u_debug', props.debug ? 1 : 0);
@@ -1 +1 @@
1
- {"version":3,"file":"SdfShader.js","sourceRoot":"","sources":["../../../../../src/core/shaders/webgl/SdfShader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAGjE,MAAM,mBAAmB,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAkB1E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,GAAG,GAAoC;IAClD,KAAK,EAAE;QACL,SAAS,EAAE,mBAAmB;QAC9B,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,EAAE;QACR,aAAa,EAAE,GAAG;QAClB,KAAK,EAAE,KAAK;KACb;IACD,SAAS,CAAC,KAAK;QACb,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,UAAU,CACb,SAAS,EACT,IAAI,YAAY,CAAC,2BAA2B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAC3D,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CA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CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BP;IACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCT;CACF,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,77 @@
1
+ checkRenderBounds();
2
+ CoreNodeRenderState;
3
+ {
4
+ assertTruthy(this.renderBound);
5
+ assertTruthy(this.strictBound);
6
+ assertTruthy(this.preloadBound);
7
+ if (boundInsideBound(this.renderBound, this.strictBound)) {
8
+ return CoreNodeRenderState.InViewport;
9
+ }
10
+ if (boundInsideBound(this.renderBound, this.preloadBound)) {
11
+ return CoreNodeRenderState.InBounds;
12
+ }
13
+ // check if we're larger then our parent, we're definitely in the viewport
14
+ if (boundLargeThanBound(this.renderBound, this.strictBound)) {
15
+ return CoreNodeRenderState.InViewport;
16
+ }
17
+ // check if we dont have dimensions, take our parent's render state
18
+ if (this.parent !== null &&
19
+ (this.props.width === 0 || this.props.height === 0)) {
20
+ return this.parent.renderState;
21
+ }
22
+ return CoreNodeRenderState.OutOfBounds;
23
+ }
24
+ updateBoundingRect();
25
+ {
26
+ const transform = this.sceneGlobalTransform || this.globalTransform;
27
+ const renderCoords = this.sceneRenderCoords || this.renderCoords;
28
+ assertTruthy(transform);
29
+ assertTruthy(renderCoords);
30
+ if (transform.tb === 0 || transform.tc === 0) {
31
+ this.renderBound = createBound(renderCoords.x1, renderCoords.y1, renderCoords.x3, renderCoords.y3, this.renderBound);
32
+ }
33
+ else {
34
+ const { x1, y1, x2, y2, x3, y3, x4, y4 } = renderCoords;
35
+ this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);
36
+ }
37
+ }
38
+ createRenderBounds();
39
+ void {
40
+ : .stage,
41
+ : .parent !== null && this.parent.strictBound !== undefined
42
+ };
43
+ {
44
+ // we have a parent with a valid bound, copy it
45
+ const parentBound = this.parent.strictBound;
46
+ this.strictBound = createBound(parentBound.x1, parentBound.y1, parentBound.x2, parentBound.y2);
47
+ this.preloadBound = createPreloadBounds(this.strictBound, this.boundsMargin);
48
+ }
49
+ {
50
+ // no parent or parent does not have a bound, take the stage boundaries
51
+ this.strictBound = this.stage.strictBound;
52
+ this.preloadBound = this.stage.preloadBound;
53
+ }
54
+ // if clipping is disabled, we're done
55
+ if (this.props.clipping === false) {
56
+ return;
57
+ }
58
+ // only create local clipping bounds if node itself is in bounds
59
+ // this can only be done if we have a render bound already
60
+ if (this.renderBound === undefined) {
61
+ return;
62
+ }
63
+ // if we're out of bounds, we're done
64
+ if (boundInsideBound(this.renderBound, this.strictBound) === false) {
65
+ return;
66
+ }
67
+ // clipping is enabled and we are in bounds create our own bounds
68
+ const { x, y, width, height } = this.props;
69
+ // Pick the global transform if available, otherwise use the local transform
70
+ // global transform is only available if the node in an RTT chain
71
+ const { tx, ty } = this.sceneGlobalTransform || this.globalTransform || {};
72
+ const _x = tx ?? x;
73
+ const _y = ty ?? y;
74
+ this.strictBound = createBound(_x, _y, _x + width, _y + height, this.strictBound);
75
+ this.preloadBound = createPreloadBounds(this.strictBound, this.boundsMargin);
76
+ export {};
77
+ //# sourceMappingURL=temp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temp.js","sourceRoot":"","sources":["../../../src/core/temp.ts"],"names":[],"mappings":"AAAE,iBAAiB,EAAE,CAAA;AAAE,mBAAmB,CAAA;AAAC,CAAC;IACxC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC/B,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC/B,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAEhC,IAAI,gBAAgB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,EA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