@jbrowse/render-core 5.0.0-beta.11 → 5.0.0-beta.14
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/esm/OverlayCanvas.d.ts +3 -2
- package/esm/OverlayCanvas.js +4 -2
- package/esm/RenderCanvas.d.ts +4 -3
- package/esm/RenderCanvas.js +4 -2
- package/esm/ScrollLockedOverlay.d.ts +2 -2
- package/esm/ScrollLockedOverlay.js +3 -2
- package/esm/blockClipUtils.d.ts +5 -5
- package/esm/blockClipUtils.js +4 -3
- package/esm/canvas2dUtils.d.ts +15 -21
- package/esm/canvas2dUtils.js +25 -55
- package/esm/colorRampLut.d.ts +2 -2
- package/esm/colorRampLut.js +2 -2
- package/esm/coverageBand.d.ts +0 -1
- package/esm/coverageBand.js +0 -5
- package/esm/coverageBandBuffers.d.ts +8 -5
- package/esm/createRenderingBackend.d.ts +1 -1
- package/esm/displayPhase.d.ts +5 -9
- package/esm/displayPhase.js +2 -2
- package/esm/hal/mockHal.d.ts +3 -4
- package/esm/hal/mockHal.js +5 -4
- package/esm/hal/types.d.ts +5 -5
- package/esm/hal/webgl2Hal.d.ts +4 -1
- package/esm/hal/webgl2Hal.js +18 -6
- package/esm/hal/webgpuHal.js +2 -2
- package/esm/linkFeet.d.ts +4 -0
- package/esm/linkFeet.js +7 -0
- package/esm/marks/barMark.d.ts +1 -1
- package/esm/marks/barMark.js +4 -2
- package/esm/marks/colorFill.d.ts +4 -4
- package/esm/marks/colorFill.js +4 -4
- package/esm/marks/connectorMark.d.ts +48 -0
- package/esm/marks/connectorMark.js +285 -0
- package/esm/marks/drawAgainstHit.d.ts +1 -1
- package/esm/marks/drawAgainstHit.js +4 -4
- package/esm/marks/glyphPaint.d.ts +5 -4
- package/esm/marks/glyphPaint.js +17 -7
- package/esm/marks/index.d.ts +8 -5
- package/esm/marks/index.js +6 -4
- package/esm/marks/lineMark.d.ts +47 -7
- package/esm/marks/lineMark.js +53 -39
- package/esm/marks/linkMark.d.ts +43 -6
- package/esm/marks/linkMark.js +118 -21
- package/esm/marks/markBackend.d.ts +1 -1
- package/esm/marks/markBackend.js +1 -1
- package/esm/marks/markPlan.d.ts +4 -3
- package/esm/marks/markPlan.js +5 -4
- package/esm/marks/markRamp.d.ts +11 -11
- package/esm/marks/markRamp.js +9 -9
- package/esm/marks/pointMark.d.ts +11 -5
- package/esm/marks/pointMark.js +34 -9
- package/esm/marks/rowLane.d.ts +4 -2
- package/esm/marks/rowLane.js +7 -3
- package/esm/marks/rowTable.d.ts +5 -5
- package/esm/marks/rowTable.js +4 -4
- package/esm/marks/ruleMark.js +1 -0
- package/esm/marks/spanMark.d.ts +8 -7
- package/esm/marks/spanMark.js +3 -3
- package/esm/marks/types.d.ts +8 -5
- package/esm/marks/types.js +8 -1
- package/esm/perRegionRenderingBackend.d.ts +1 -1
- package/esm/perRegionRenderingBackend.js +1 -1
- package/esm/regionDataMap.d.ts +2 -2
- package/esm/regionDataMap.js +2 -2
- package/esm/shaders/barMark.glsl.generated.d.ts +1 -1
- package/esm/shaders/barMark.glsl.generated.js +1 -1
- package/esm/shaders/barMark.wgsl.generated.d.ts +1 -1
- package/esm/shaders/barMark.wgsl.generated.js +1 -1
- package/esm/shaders/capsule.js.generated.d.ts +1 -1
- package/esm/shaders/capsule.js.generated.js +2 -2
- package/esm/shaders/connectorMark.consts.generated.d.ts +11 -0
- package/esm/shaders/connectorMark.consts.generated.js +13 -0
- package/esm/shaders/{coverageIndicator.generated.d.ts → connectorMark.generated.d.ts} +2 -1
- package/esm/shaders/connectorMark.generated.js +8 -0
- package/esm/shaders/connectorMark.glsl.generated.d.ts +2 -0
- package/esm/shaders/connectorMark.glsl.generated.js +4 -0
- package/esm/shaders/connectorMark.iface.generated.d.ts +88 -0
- package/esm/shaders/connectorMark.iface.generated.js +1194 -0
- package/esm/shaders/connectorMark.js.generated.d.ts +5 -0
- package/esm/shaders/connectorMark.js.generated.js +47 -0
- package/esm/shaders/connectorMark.wgsl.generated.d.ts +1 -0
- package/esm/shaders/connectorMark.wgsl.generated.js +3 -0
- package/esm/shaders/coverageInterbase.glsl.generated.d.ts +1 -1
- package/esm/shaders/coverageInterbase.glsl.generated.js +1 -1
- package/esm/shaders/coverageInterbase.wgsl.generated.d.ts +1 -1
- package/esm/shaders/coverageInterbase.wgsl.generated.js +1 -1
- package/esm/shaders/curveDistance.js.generated.d.ts +4 -0
- package/esm/shaders/curveDistance.js.generated.js +113 -0
- package/esm/shaders/insertionGlyph.generated.d.ts +6 -0
- package/esm/shaders/insertionGlyph.generated.js +8 -0
- package/esm/shaders/lineCenterMark.glsl.generated.d.ts +2 -2
- package/esm/shaders/lineCenterMark.glsl.generated.js +2 -2
- package/esm/shaders/lineCenterMark.iface.generated.d.ts +11 -9
- package/esm/shaders/lineCenterMark.iface.generated.js +20 -18
- package/esm/shaders/lineCenterMark.wgsl.generated.d.ts +1 -1
- package/esm/shaders/lineCenterMark.wgsl.generated.js +1 -1
- package/esm/shaders/lineCommon.js.generated.d.ts +1 -0
- package/esm/shaders/lineCommon.js.generated.js +20 -0
- package/esm/shaders/lineStepMark.glsl.generated.d.ts +2 -2
- package/esm/shaders/lineStepMark.glsl.generated.js +2 -2
- package/esm/shaders/lineStepMark.iface.generated.d.ts +11 -9
- package/esm/shaders/lineStepMark.iface.generated.js +20 -18
- package/esm/shaders/lineStepMark.wgsl.generated.d.ts +1 -1
- package/esm/shaders/lineStepMark.wgsl.generated.js +1 -1
- package/esm/shaders/linkMark.consts.generated.d.ts +1 -0
- package/esm/shaders/linkMark.consts.generated.js +1 -0
- package/esm/shaders/linkMark.glsl.generated.d.ts +2 -2
- package/esm/shaders/linkMark.glsl.generated.js +2 -2
- package/esm/shaders/linkMark.js.generated.d.ts +4 -2
- package/esm/shaders/linkMark.js.generated.js +33 -4
- package/esm/shaders/linkMark.wgsl.generated.d.ts +1 -1
- package/esm/shaders/linkMark.wgsl.generated.js +1 -1
- package/esm/shaders/pointMark.glsl.generated.d.ts +1 -1
- package/esm/shaders/pointMark.glsl.generated.js +1 -1
- package/esm/shaders/pointMark.iface.generated.d.ts +10 -8
- package/esm/shaders/pointMark.iface.generated.js +18 -16
- package/esm/shaders/pointMark.wgsl.generated.d.ts +1 -1
- package/esm/shaders/pointMark.wgsl.generated.js +1 -1
- package/esm/shaders/spanMark.glsl.generated.d.ts +1 -1
- package/esm/shaders/spanMark.glsl.generated.js +1 -1
- package/esm/shaders/spanMark.wgsl.generated.d.ts +1 -1
- package/esm/shaders/spanMark.wgsl.generated.js +1 -1
- package/esm/slangPass.d.ts +5 -3
- package/esm/slangPass.js +2 -2
- package/package.json +7 -4
- package/src/shaders/arcHull.test.ts +87 -0
- package/src/shaders/barMark.glsl.generated.ts +1 -1
- package/src/shaders/barMark.slang +2 -2
- package/src/shaders/barMark.wgsl.generated.ts +1 -1
- package/src/shaders/capsule.js.generated.ts +2 -2
- package/src/shaders/capsule.slang +69 -24
- package/src/shaders/clipStrip.slang +1 -1
- package/src/shaders/colorPack.slang +2 -2
- package/src/shaders/colorRampLut.slang +7 -7
- package/src/shaders/connectorMark.consts.generated.ts +24 -0
- package/src/shaders/connectorMark.generated.ts +12 -0
- package/src/shaders/connectorMark.glsl.generated.ts +6 -0
- package/src/shaders/connectorMark.iface.generated.ts +1270 -0
- package/src/shaders/connectorMark.js.generated.ts +52 -0
- package/src/shaders/connectorMark.slang +287 -0
- package/src/shaders/connectorMark.wgsl.generated.ts +4 -0
- package/src/shaders/coverageBand.slang +10 -12
- package/src/shaders/coverageInterbase.glsl.generated.ts +1 -1
- package/src/shaders/coverageInterbase.slang +24 -21
- package/src/shaders/coverageInterbase.wgsl.generated.ts +1 -1
- package/src/shaders/coverageSnp.slang +1 -1
- package/src/shaders/curveDistance.js.generated.ts +112 -0
- package/src/shaders/curveDistance.slang +104 -1
- package/src/shaders/farDome.test.ts +117 -0
- package/src/shaders/hpClampFloor.test.ts +0 -4
- package/src/shaders/insertionGlyph.generated.ts +14 -0
- package/src/shaders/insertionGlyph.slang +59 -0
- package/src/shaders/lineCenterMark.glsl.generated.ts +2 -2
- package/src/shaders/lineCenterMark.iface.generated.ts +21 -18
- package/src/shaders/lineCenterMark.slang +19 -23
- package/src/shaders/lineCenterMark.wgsl.generated.ts +1 -1
- package/src/shaders/lineCommon.js.generated.ts +20 -0
- package/src/shaders/lineCommon.slang +18 -8
- package/src/shaders/lineStepMark.glsl.generated.ts +2 -2
- package/src/shaders/lineStepMark.iface.generated.ts +21 -18
- package/src/shaders/lineStepMark.slang +10 -6
- package/src/shaders/lineStepMark.wgsl.generated.ts +1 -1
- package/src/shaders/linkMark.consts.generated.ts +2 -0
- package/src/shaders/linkMark.glsl.generated.ts +2 -2
- package/src/shaders/linkMark.js.generated.ts +30 -4
- package/src/shaders/linkMark.slang +67 -24
- package/src/shaders/linkMark.wgsl.generated.ts +1 -1
- package/src/shaders/markColor.slang +10 -10
- package/src/shaders/pointMark.glsl.generated.ts +1 -1
- package/src/shaders/pointMark.iface.generated.ts +19 -16
- package/src/shaders/pointMark.slang +12 -8
- package/src/shaders/pointMark.wgsl.generated.ts +1 -1
- package/src/shaders/rowRect.slang +3 -3
- package/src/shaders/rowTable.slang +12 -8
- package/src/shaders/scoreScale.slang +1 -1
- package/src/shaders/spanMark.glsl.generated.ts +1 -1
- package/src/shaders/spanMark.slang +5 -5
- package/src/shaders/spanMark.wgsl.generated.ts +1 -1
- package/src/shaders/viewRegion.slang +13 -0
- package/esm/shaders/coverageIndicator.generated.js +0 -7
- package/esm/shaders/coverageIndicator.glsl.generated.d.ts +0 -2
- package/esm/shaders/coverageIndicator.glsl.generated.js +0 -4
- package/esm/shaders/coverageIndicator.iface.generated.d.ts +0 -85
- package/esm/shaders/coverageIndicator.iface.generated.js +0 -114
- package/esm/shaders/coverageIndicator.wgsl.generated.d.ts +0 -1
- package/esm/shaders/coverageIndicator.wgsl.generated.js +0 -3
- package/src/shaders/coverageIndicator.generated.ts +0 -11
- package/src/shaders/coverageIndicator.glsl.generated.ts +0 -6
- package/src/shaders/coverageIndicator.iface.generated.ts +0 -172
- package/src/shaders/coverageIndicator.slang +0 -61
- package/src/shaders/coverageIndicator.wgsl.generated.ts +0 -4
|
@@ -4,15 +4,27 @@
|
|
|
4
4
|
// Scalar twins of curveDistance.slang, transliterated from slangc's WGSL so
|
|
5
5
|
// the Canvas2D and SVG paths run the shader's own math. See adr-051.
|
|
6
6
|
|
|
7
|
+
function _clamp(x: number, lo: number, hi: number) {
|
|
8
|
+
return _min(_max(x, lo), hi)
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
function _max(a: number, b: number) {
|
|
8
12
|
return b > a || Number.isNaN(a) ? b : a
|
|
9
13
|
}
|
|
10
14
|
|
|
15
|
+
function _min(a: number, b: number) {
|
|
16
|
+
return b < a || Number.isNaN(a) ? b : a
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
export function distToWideCirclePx(x: number, y: number, r: number): number {
|
|
12
20
|
let rk = ((2.0 * x) + (((x * x) + (y * y)) / r))
|
|
13
21
|
return Math.abs((rk / (Math.sqrt(_max((1.0 + (rk / r)), 0.0)) + 1.0)))
|
|
14
22
|
}
|
|
15
23
|
|
|
24
|
+
export function legSweepAngle(radiusPx: number, yReachPx: number): number {
|
|
25
|
+
return Math.asin(_clamp((yReachPx / _max(radiusPx, 9.99999997475242708e-07)), 0.0, 1.0))
|
|
26
|
+
}
|
|
27
|
+
|
|
16
28
|
export function wideCircleLeg(seg: number, segments: number, legSweep: number): [number, number] {
|
|
17
29
|
let half = Math.trunc(segments / 2)
|
|
18
30
|
if ((seg <= half)) {
|
|
@@ -89,3 +101,103 @@ export function wideCircleHullPoint(sinB: number, sinHalfB: number, cosHalf: num
|
|
|
89
101
|
let sh2 = (sinHalfB * sinHalfB)
|
|
90
102
|
return [((grow * (1.0 - (2.0 * sh2))) - ((2.0 * radiusPx) * sh2)), ((radiusPx + grow) * sinB)]
|
|
91
103
|
}
|
|
104
|
+
|
|
105
|
+
export function farDomeParam(dPx: number, rxPx: number): number {
|
|
106
|
+
return Math.sqrt(_clamp((dPx / (2.0 * _max(rxPx, 9.99999997475242708e-07))), 0.0, 0.8399999737739563))
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function farDomeHullPoint(u: number, stepU: number, rxPx: number, ryPx: number, padPx: number): [number, number] {
|
|
110
|
+
let _t0 = _max(ryPx, 9.99999997475242708e-07)
|
|
111
|
+
let _t1 = _max(u, (0.5 * stepU))
|
|
112
|
+
let nx = (-_t0 * (1.0 - ((2.0 * _t1) * _t1)))
|
|
113
|
+
let _t2 = (2.0 * rxPx)
|
|
114
|
+
let ny = ((_t2 * _t1) * Math.sqrt((1.0 - (_t1 * _t1))))
|
|
115
|
+
let _t3 = _max(((nx * nx) + (ny * ny)), 9.99999968265522539e-21)
|
|
116
|
+
let reach = (padPx + (((((((Math.sign(padPx)) | 0)) * 0.5) * rxPx) * stepU) * stepU))
|
|
117
|
+
let _t4 = Math.sqrt(_t3)
|
|
118
|
+
let along = (reach / _t4)
|
|
119
|
+
let d = ((_t2 * u) * u)
|
|
120
|
+
let _t5 = (u * u)
|
|
121
|
+
let h = (((2.0 * _t0) * u) * Math.sqrt((1.0 - _t5)))
|
|
122
|
+
let folded: boolean
|
|
123
|
+
if ((padPx < 0.0)) {
|
|
124
|
+
folded = (_t5 < 0.5)
|
|
125
|
+
} else {
|
|
126
|
+
folded = false
|
|
127
|
+
}
|
|
128
|
+
if (folded) {
|
|
129
|
+
folded = ((_t3 * _t4) < (((-2.0 * reach) * rxPx) * _t0))
|
|
130
|
+
} else {
|
|
131
|
+
folded = false
|
|
132
|
+
}
|
|
133
|
+
let _t6: number
|
|
134
|
+
if (folded) {
|
|
135
|
+
if ((u > 0.0)) {
|
|
136
|
+
_t6 = (d - reach)
|
|
137
|
+
} else {
|
|
138
|
+
_t6 = d
|
|
139
|
+
}
|
|
140
|
+
} else {
|
|
141
|
+
_t6 = (d + (nx * along))
|
|
142
|
+
}
|
|
143
|
+
let _t7: number
|
|
144
|
+
if (folded) {
|
|
145
|
+
_t7 = (h + reach)
|
|
146
|
+
} else {
|
|
147
|
+
_t7 = (h + (ny * along))
|
|
148
|
+
}
|
|
149
|
+
return [_t6, _t7]
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function farDomeDistSq(u: number, dPx: number, hPx: number, rx: number, ry: number): number {
|
|
153
|
+
let ox = ((((2.0 * rx) * u) * u) - dPx)
|
|
154
|
+
let oy = ((((2.0 * ry) * u) * Math.sqrt(_max((1.0 - (u * u)), 0.0))) - hPx)
|
|
155
|
+
return ((ox * ox) + (oy * oy))
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function farDomeStep(u: number, dPx: number, hPx: number, rx: number, ry: number): number {
|
|
159
|
+
let w = Math.sqrt(_max((1.0 - (u * u)), 9.99999997475242708e-07))
|
|
160
|
+
let ox = ((((2.0 * rx) * u) * u) - dPx)
|
|
161
|
+
let _t0 = (2.0 * ry)
|
|
162
|
+
let _t1 = (_t0 * u)
|
|
163
|
+
let oy = ((_t1 * w) - hPx)
|
|
164
|
+
let _t2 = (4.0 * rx)
|
|
165
|
+
let dx = (_t2 * u)
|
|
166
|
+
let _t3 = ((2.0 * u) * u)
|
|
167
|
+
let dy = ((_t0 * (1.0 - _t3)) / w)
|
|
168
|
+
let whole = _clamp((u - (((ox * dx) + (oy * dy)) / _max(((((dx * dx) + (dy * dy)) + (ox * _t2)) + (oy * ((_t1 * (_t3 - 3.0)) / ((w * w) * w)))), 9.999999960041972e-13))), 0.0, 0.99900001287460327)
|
|
169
|
+
let half = (0.5 * (u + whole))
|
|
170
|
+
let here = ((ox * ox) + (oy * oy))
|
|
171
|
+
let _t4: number
|
|
172
|
+
if ((farDomeDistSq(whole, dPx, hPx, rx, ry) < here)) {
|
|
173
|
+
_t4 = whole
|
|
174
|
+
} else {
|
|
175
|
+
if ((farDomeDistSq(half, dPx, hPx, rx, ry) < here)) {
|
|
176
|
+
_t4 = half
|
|
177
|
+
} else {
|
|
178
|
+
_t4 = u
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return _t4
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function farDomeDistancePx(dPx: number, hPx: number, rxPx: number, ryPx: number): number {
|
|
185
|
+
let _t0 = _max(rxPx, 9.99999997475242708e-07)
|
|
186
|
+
let _t1 = _max(ryPx, 9.99999997475242708e-07)
|
|
187
|
+
let q = _clamp((hPx / _t1), 0.0, 1.0)
|
|
188
|
+
let c = Math.sqrt((1.0 - (q * q)))
|
|
189
|
+
let uH: number
|
|
190
|
+
if ((dPx > _t0)) {
|
|
191
|
+
uH = Math.sqrt((0.5 * (1.0 + c)))
|
|
192
|
+
} else {
|
|
193
|
+
uH = (q / Math.sqrt((2.0 * (1.0 + c))))
|
|
194
|
+
}
|
|
195
|
+
let uD = Math.sqrt(_clamp((dPx / (2.0 * _t0)), 0.0, 1.0))
|
|
196
|
+
let u: number
|
|
197
|
+
if ((farDomeDistSq(uH, dPx, hPx, _t0, _t1) < farDomeDistSq(uD, dPx, hPx, _t0, _t1))) {
|
|
198
|
+
u = uH
|
|
199
|
+
} else {
|
|
200
|
+
u = uD
|
|
201
|
+
}
|
|
202
|
+
return Math.sqrt(farDomeDistSq(farDomeStep(farDomeStep(farDomeStep(farDomeStep(u, dPx, hPx, _t0, _t1), dPx, hPx, _t0, _t1), dPx, hPx, _t0, _t1), dPx, hPx, _t0, _t1), dPx, hPx, _t0, _t1))
|
|
203
|
+
}
|
|
@@ -7,10 +7,14 @@
|
|
|
7
7
|
// The fragment ramps its alpha to zero at `halfWidth + aaHalfPx`, so the hull
|
|
8
8
|
// has to cover everything nearer the curve than that. Both flanks of a hull
|
|
9
9
|
// sampled from the offset curve fall short of it at a clamped dome's feet.
|
|
10
|
-
//! js-export: distToWideCirclePx, wideCircleLeg, wideCircleLegStep, ellipseHullPoint, wideCircleHullPoint
|
|
10
|
+
//! js-export: distToWideCirclePx, legSweepAngle, wideCircleLeg, wideCircleLegStep, ellipseHullPoint, wideCircleHullPoint, farDomeParam, farDomeHullPoint, farDomeDistancePx
|
|
11
11
|
//! js-skip: nearCircleDistancePx — a float32 remedy with no float64 caller. The hit tests' copy of this file's solve (marks/ellipseDistance.ts) holds the ellipse at every aspect, so nothing outside the shader has an approximation to want.
|
|
12
|
+
//! js-skip: farDomeDistSq — a step of farDomeDistancePx's solve, which its twin carries; nothing outside it wants one step
|
|
13
|
+
//! js-skip: farDomeStep — a step of farDomeDistancePx's solve, so it inherits farDomeDistSq's reason exactly
|
|
12
14
|
//! oracle-skip: ellipseHullPoint — a miter between near-parallel tangent lines, so float32 and float64 part on the probe's arbitrary directions and radii; over the angles the hull steps through they agree to 0.004 px, and arcHull.test.ts referees the twin against every inked point instead
|
|
13
15
|
//! oracle-skip: wideCircleHullPoint — the foot-relative frame cancels at half steps and angles the band never reaches; arcHull.test.ts referees it with the legs
|
|
16
|
+
//! oracle-skip: farDomeDistancePx — at the probe's 65536 px ry, q = h / ry and 1 - q² round to the same float32, so the solve starts from the wrong foot and lands up to 18 px out; ry is the arc band, tens of px, where float32 and float64 agree, and farDome.test.ts referees the twin against an exact solve
|
|
17
|
+
//! oracle-skip: farDomeStep — a step of farDomeDistancePx's solve, so it inherits that reason; the probe also feeds it negative radii and widths the solve never reaches
|
|
14
18
|
|
|
15
19
|
module curveDistance;
|
|
16
20
|
|
|
@@ -163,6 +167,105 @@ public float distToWideCircle(float2 legLocal, float r) {
|
|
|
163
167
|
return distToWideCirclePx(legLocal.x, legLocal.y, r);
|
|
164
168
|
}
|
|
165
169
|
|
|
170
|
+
// A far pair whose apex is low is not a circle: it is a dome thousands of px
|
|
171
|
+
// wide and tens tall, which over one canvas is a nearly level line. The
|
|
172
|
+
// functions below measure it from a foot, so nothing cancels at these radii.
|
|
173
|
+
//
|
|
174
|
+
// u = sin(b / 2) for the angle b from a foot at which the dome is `d` px inward
|
|
175
|
+
// of that foot, by the half-angle identity d = 2 rx sin^2(b / 2). Held short of
|
|
176
|
+
// the far foot, where the height's slope in u has no bound: the foot is the
|
|
177
|
+
// nearer one, and a far pair's canvas reaches under a third of the way past
|
|
178
|
+
// the apex.
|
|
179
|
+
public float farDomeParam(float dPx, float rxPx) {
|
|
180
|
+
return sqrt(clamp(dPx / (2.0 * max(rxPx, 1e-6)), 0.0, 0.84));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// One vertex of a far dome's strip in the frame `farDomeDistancePx` measures
|
|
184
|
+
// in, inward of a foot and up: the dome's point at `u`, `padPx` along its own
|
|
185
|
+
// normal, positive on the outer flank. `stepU` is the strip's step in u. The
|
|
186
|
+
// dome leaves its foot upright and is level within a px, so the foot's normal
|
|
187
|
+
// is its first chord's, and a chord cuts inside the curve by its sagitta,
|
|
188
|
+
// which the pad takes on.
|
|
189
|
+
//
|
|
190
|
+
// A flat dome turns tighter than the pad at its foot (radius ry^2 / rx), where
|
|
191
|
+
// the inner offset folds and its chords cut the ink. There the inner flank is
|
|
192
|
+
// the dome moved a pad inward and a pad down instead: the dome rises as it
|
|
193
|
+
// runs inward, so that copy clears the pad around every point of it, and it is
|
|
194
|
+
// as concave as the dome, so its chords clear it too. The foot's own vertex
|
|
195
|
+
// stays under the foot, where the strip's end crosses it.
|
|
196
|
+
public float2 farDomeHullPoint(float u, float stepU, float rxPx, float ryPx, float padPx) {
|
|
197
|
+
float ry = max(ryPx, 1e-6);
|
|
198
|
+
float un = max(u, 0.5 * stepU);
|
|
199
|
+
float nx = -ry * (1.0 - 2.0 * un * un);
|
|
200
|
+
float ny = 2.0 * rxPx * un * sqrt(1.0 - un * un);
|
|
201
|
+
float lenSq = max(nx * nx + ny * ny, 1e-20);
|
|
202
|
+
float reach = padPx + sign(padPx) * 0.5 * rxPx * stepU * stepU;
|
|
203
|
+
float along = reach / sqrt(lenSq);
|
|
204
|
+
float d = 2.0 * rxPx * u * u;
|
|
205
|
+
float h = 2.0 * ry * u * sqrt(1.0 - u * u);
|
|
206
|
+
// the radius of curvature, against twice the pad
|
|
207
|
+
bool folded = padPx < 0.0 && u * u < 0.5
|
|
208
|
+
&& lenSq * sqrt(lenSq) < -2.0 * reach * rxPx * ry;
|
|
209
|
+
return float2(folded ? (u > 0.0 ? d - reach : d) : d + nx * along,
|
|
210
|
+
folded ? h + reach : h + ny * along);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// A far dome's point in the frame of one of its feet, by u = sin(b / 2) for the
|
|
214
|
+
// angle b from that foot: 2 rx u^2 inward of the foot, 2 ry u sqrt(1 - u^2)
|
|
215
|
+
// up. No trigonometry, so the twin the hit tests' referee runs is this code.
|
|
216
|
+
float farDomeDistSq(float u, float dPx, float hPx, float rx, float ry) {
|
|
217
|
+
float ox = 2.0 * rx * u * u - dPx;
|
|
218
|
+
float oy = 2.0 * ry * u * sqrt(max(1.0 - u * u, 0.0)) - hPx;
|
|
219
|
+
return ox * ox + oy * oy;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// One Newton step toward the u whose dome point is nearest the fragment. Held
|
|
223
|
+
// short of 1, the far foot, where the height's slope in u has no bound; the
|
|
224
|
+
// frame is the nearer foot's, so the answer is never there.
|
|
225
|
+
float farDomeStep(float u, float dPx, float hPx, float rx, float ry) {
|
|
226
|
+
float w = sqrt(max(1.0 - u * u, 1e-6));
|
|
227
|
+
float ox = 2.0 * rx * u * u - dPx;
|
|
228
|
+
float oy = 2.0 * ry * u * w - hPx;
|
|
229
|
+
float dx = 4.0 * rx * u;
|
|
230
|
+
float dy = 2.0 * ry * (1.0 - 2.0 * u * u) / w;
|
|
231
|
+
float ddx = 4.0 * rx;
|
|
232
|
+
float ddy = 2.0 * ry * u * (2.0 * u * u - 3.0) / (w * w * w);
|
|
233
|
+
float f = ox * dx + oy * dy;
|
|
234
|
+
float df = dx * dx + dy * dy + ox * ddx + oy * ddy;
|
|
235
|
+
// A foot is a tip sharper than a px, where the step overshoots: it is taken
|
|
236
|
+
// whole or by half, and only where it lands nearer.
|
|
237
|
+
float whole = clamp(u - f / max(df, 1e-12), 0.0, 0.999);
|
|
238
|
+
float half = 0.5 * (u + whole);
|
|
239
|
+
float here = ox * ox + oy * oy;
|
|
240
|
+
return farDomeDistSq(whole, dPx, hPx, rx, ry) < here
|
|
241
|
+
? whole
|
|
242
|
+
: (farDomeDistSq(half, dPx, hPx, rx, ry) < here ? half : u);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Distance from a fragment to a far dome, in the frame of one of its feet: the
|
|
246
|
+
// fragment `dPx` inward of the foot and `hPx` above the baseline. Newton's
|
|
247
|
+
// method from the nearer of the dome's point level with the fragment, which is
|
|
248
|
+
// the near one where the dome is steep at its feet, and its point above or
|
|
249
|
+
// below it, which is near everywhere else. Every term is assembled from the
|
|
250
|
+
// foot, so a width in the millions of px cancels nothing.
|
|
251
|
+
public float farDomeDistancePx(float dPx, float hPx, float rxPx, float ryPx) {
|
|
252
|
+
float rx = max(rxPx, 1e-6);
|
|
253
|
+
float ry = max(ryPx, 1e-6);
|
|
254
|
+
float q = clamp(hPx / ry, 0.0, 1.0);
|
|
255
|
+
float c = sqrt(1.0 - q * q);
|
|
256
|
+
// sin(b / 2) for sin(b) = q, on this foot's half or the far one's
|
|
257
|
+
float uH = dPx > rx ? sqrt(0.5 * (1.0 + c)) : q / sqrt(2.0 * (1.0 + c));
|
|
258
|
+
float uD = sqrt(clamp(dPx / (2.0 * rx), 0.0, 1.0));
|
|
259
|
+
float u = farDomeDistSq(uH, dPx, hPx, rx, ry) < farDomeDistSq(uD, dPx, hPx, rx, ry)
|
|
260
|
+
? uH
|
|
261
|
+
: uD;
|
|
262
|
+
u = farDomeStep(u, dPx, hPx, rx, ry);
|
|
263
|
+
u = farDomeStep(u, dPx, hPx, rx, ry);
|
|
264
|
+
u = farDomeStep(u, dPx, hPx, rx, ry);
|
|
265
|
+
u = farDomeStep(u, dPx, hPx, rx, ry);
|
|
266
|
+
return sqrt(farDomeDistSq(u, dPx, hPx, rx, ry));
|
|
267
|
+
}
|
|
268
|
+
|
|
166
269
|
// How far around a far circle each leg's hull sweeps, in radians from its foot:
|
|
167
270
|
// to the band's edge and no further. Sweeping the whole quarter spends nearly
|
|
168
271
|
// every segment off-screen, and at r = 3e6 px the whole band then falls inside
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ellipseNearest } from '../marks/ellipseDistance.ts'
|
|
2
|
+
import {
|
|
3
|
+
farDomeDistancePx,
|
|
4
|
+
farDomeParam,
|
|
5
|
+
} from './curveDistance.js.generated.ts'
|
|
6
|
+
|
|
7
|
+
// A far dome is an ellipse thousands to millions of px wide and tens tall. The
|
|
8
|
+
// fragment measures to it from one of its feet (`farDomeDistancePx`), where
|
|
9
|
+
// nothing cancels, and these hold that to the exact ellipse distance at the
|
|
10
|
+
// widths a far pair reaches and the strokes a link draws, over the half of the
|
|
11
|
+
// dome nearer the foot it measures from, which is the half the shader asks of
|
|
12
|
+
// it. Under the baseline the stroke is still the rising half's, where the exact
|
|
13
|
+
// solve would answer with the mirrored half, so the referee there is the foot
|
|
14
|
+
// or the level point, whichever is nearer.
|
|
15
|
+
|
|
16
|
+
// A point `offPx` along the dome's outward normal from its point at angle `b`
|
|
17
|
+
// from the left foot: inward of that foot by `d` and up by `h`.
|
|
18
|
+
function probe(rx: number, ry: number, b: number, offPx: number) {
|
|
19
|
+
const nx = -Math.cos(b) * ry
|
|
20
|
+
const ny = Math.sin(b) * rx
|
|
21
|
+
const len = Math.hypot(nx, ny)
|
|
22
|
+
return {
|
|
23
|
+
d: 2 * rx * Math.sin(b / 2) ** 2 + (nx / len) * offPx,
|
|
24
|
+
h: ry * Math.sin(b) + (ny / len) * offPx,
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
describe('farDomeDistancePx', () => {
|
|
29
|
+
const domes: [number, number][] = [
|
|
30
|
+
[3000, 40],
|
|
31
|
+
[3000, 300],
|
|
32
|
+
[100_000, 40],
|
|
33
|
+
[1_000_000, 40],
|
|
34
|
+
[1_000_000, 90],
|
|
35
|
+
[10_000_000, 90],
|
|
36
|
+
]
|
|
37
|
+
const angles = [
|
|
38
|
+
0.0005,
|
|
39
|
+
0.002,
|
|
40
|
+
0.01,
|
|
41
|
+
0.05,
|
|
42
|
+
0.2,
|
|
43
|
+
0.6,
|
|
44
|
+
1,
|
|
45
|
+
1.4,
|
|
46
|
+
Math.PI / 2,
|
|
47
|
+
1.7,
|
|
48
|
+
1.9,
|
|
49
|
+
]
|
|
50
|
+
const offsets = [-8, -4, -1.5, -0.5, 0, 0.5, 1.5, 4, 8]
|
|
51
|
+
|
|
52
|
+
test.each(domes)('rx %d, ry %d agrees with the ellipse', (rx, ry) => {
|
|
53
|
+
let worst = 0
|
|
54
|
+
for (const b of angles) {
|
|
55
|
+
for (const off of offsets) {
|
|
56
|
+
const { d, h } = probe(rx, ry, b, off)
|
|
57
|
+
if (h >= 0) {
|
|
58
|
+
const exact = ellipseNearest(d - rx, -h, rx, ry).dist
|
|
59
|
+
worst = Math.max(
|
|
60
|
+
worst,
|
|
61
|
+
Math.abs(farDomeDistancePx(d, h, rx, ry) - exact),
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// the worst is inside a foot, a tip sharper than a px, where no step
|
|
67
|
+
// lands nearer than the start
|
|
68
|
+
expect(worst).toBeLessThan(0.05)
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
test.each(domes)(
|
|
72
|
+
'rx %d, ry %d measures to the rising half from under the baseline',
|
|
73
|
+
(rx, ry) => {
|
|
74
|
+
for (const d of [-3, 0, 0.5, 3, 40, 900]) {
|
|
75
|
+
for (const h of [-0.5, -2, -5]) {
|
|
76
|
+
let exact = Math.hypot(d, h)
|
|
77
|
+
for (let k = 1; k <= 20_000; k++) {
|
|
78
|
+
const x = (k / 20_000) * Math.max(4 * d, 40)
|
|
79
|
+
const y = ry * Math.sqrt(Math.max(1 - (1 - x / rx) ** 2, 0))
|
|
80
|
+
exact = Math.min(exact, Math.hypot(d - x, h - y))
|
|
81
|
+
}
|
|
82
|
+
// the hull hands the fragment nothing further off than its pad
|
|
83
|
+
if (exact < 10) {
|
|
84
|
+
expect(
|
|
85
|
+
Math.abs(farDomeDistancePx(d, h, rx, ry) - exact),
|
|
86
|
+
).toBeLessThan(0.05)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
it('measures to the foot from outside the pair', () => {
|
|
94
|
+
expect(farDomeDistancePx(-5, 0, 1_000_000, 40)).toBeCloseTo(5)
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it('is the height short of the apex in the middle of the pair', () => {
|
|
98
|
+
expect(farDomeDistancePx(1_000_000, 37, 1_000_000, 40)).toBeCloseTo(3)
|
|
99
|
+
expect(farDomeDistancePx(1_000_500, 44, 1_000_000, 40)).toBeCloseTo(4)
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
describe('farDomeParam', () => {
|
|
104
|
+
it('is sin(b / 2) where the dome is that far inward of its foot', () => {
|
|
105
|
+
for (const rx of [3000, 1_000_000]) {
|
|
106
|
+
for (const b of [0.001, 0.3, 1.2, Math.PI / 2, 2.2]) {
|
|
107
|
+
const d = 2 * rx * Math.sin(b / 2) ** 2
|
|
108
|
+
expect(farDomeParam(d, rx)).toBeCloseTo(Math.sin(b / 2), 6)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
it('holds at the foot outside the pair and short of the far foot', () => {
|
|
114
|
+
expect(farDomeParam(-50, 3000)).toBe(0)
|
|
115
|
+
expect(farDomeParam(7000, 3000)).toBeCloseTo(Math.sqrt(0.84))
|
|
116
|
+
})
|
|
117
|
+
})
|
|
@@ -12,8 +12,6 @@ import { GLSL_VERTEX as barMarkGlsl } from './barMark.glsl.generated.ts'
|
|
|
12
12
|
import { WGSL_SOURCE as barMarkWgsl } from './barMark.wgsl.generated.ts'
|
|
13
13
|
import { GLSL_VERTEX as coverageBarGlsl } from './coverageBar.glsl.generated.ts'
|
|
14
14
|
import { WGSL_SOURCE as coverageBarWgsl } from './coverageBar.wgsl.generated.ts'
|
|
15
|
-
import { GLSL_VERTEX as coverageIndicatorGlsl } from './coverageIndicator.glsl.generated.ts'
|
|
16
|
-
import { WGSL_SOURCE as coverageIndicatorWgsl } from './coverageIndicator.wgsl.generated.ts'
|
|
17
15
|
import { GLSL_VERTEX as coverageInterbaseGlsl } from './coverageInterbase.glsl.generated.ts'
|
|
18
16
|
import { WGSL_SOURCE as coverageInterbaseWgsl } from './coverageInterbase.wgsl.generated.ts'
|
|
19
17
|
import { GLSL_VERTEX as coverageModGlsl } from './coverageMod.glsl.generated.ts'
|
|
@@ -30,8 +28,6 @@ const SOURCES = {
|
|
|
30
28
|
'barMark glsl': barMarkGlsl,
|
|
31
29
|
'coverageBar wgsl': coverageBarWgsl,
|
|
32
30
|
'coverageBar glsl': coverageBarGlsl,
|
|
33
|
-
'coverageIndicator wgsl': coverageIndicatorWgsl,
|
|
34
|
-
'coverageIndicator glsl': coverageIndicatorGlsl,
|
|
35
31
|
'coverageInterbase wgsl': coverageInterbaseWgsl,
|
|
36
32
|
'coverageInterbase glsl': coverageInterbaseGlsl,
|
|
37
33
|
'coverageMod wgsl': coverageModWgsl,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// AUTO-GENERATED by packages/shader-tools/src/shader-codegen from insertionGlyph.slang.
|
|
2
|
+
// Do not edit. Run `pnpm gen:shaders` to regenerate.
|
|
3
|
+
|
|
4
|
+
export const LONG_INSERTION_MIN_LENGTH = 10
|
|
5
|
+
|
|
6
|
+
export const LONG_INSERTION_TEXT_THRESHOLD_PX = 15
|
|
7
|
+
|
|
8
|
+
export const MIN_HEIGHT_FOR_TEXT = 5
|
|
9
|
+
|
|
10
|
+
export const INSERTION_SERIF_MIN_PX_PER_BP = 3
|
|
11
|
+
|
|
12
|
+
export const SERIF_HALF_W_PX = 2
|
|
13
|
+
|
|
14
|
+
export const SERIF_H_PX = 2
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// The insertion glyph's geometry: the marker's width, its serif caps, and
|
|
2
|
+
// whether it outgrows the reference span it stands on. The pileup's insertion
|
|
3
|
+
// pass and alignments-core's `insertion` mark both import it, and the Canvas2D,
|
|
4
|
+
// SVG and hit-test paths run its generated twins (adr-051).
|
|
5
|
+
//
|
|
6
|
+
// A marker is a 1px tick (small), a 1-5px bar (long), or a box sized for its
|
|
7
|
+
// count label (large: long, zoomed in past LONG_INSERTION_TEXT_THRESHOLD_PX,
|
|
8
|
+
// and in a row at least MIN_HEIGHT_FOR_TEXT tall). The long bar floors at 1px
|
|
9
|
+
// so the width stays monotonic in length; a sub-pixel bar rasterizes to a
|
|
10
|
+
// fraction of a column on either backend.
|
|
11
|
+
//
|
|
12
|
+
// Serif caps are wedges SERIF_HALF_W_PX either side of the bar, tapering
|
|
13
|
+
// SERIF_H_PX into the row, on small insertions zoomed in past
|
|
14
|
+
// INSERTION_SERIF_MIN_PX_PER_BP.
|
|
15
|
+
//! export-consts: LONG_INSERTION_MIN_LENGTH, LONG_INSERTION_TEXT_THRESHOLD_PX, MIN_HEIGHT_FOR_TEXT, INSERTION_SERIF_MIN_PX_PER_BP, SERIF_HALF_W_PX, SERIF_H_PX
|
|
16
|
+
//! consts-out: packages/alignments-core/src/insertionLabel.generated.ts
|
|
17
|
+
//! js-export: insertionBarWidthPx, textWidth, insertionSerifsDraw, insertionMarkerDraws
|
|
18
|
+
//! js-export-out: packages/alignments-core/src/insertionWidth.generated.ts
|
|
19
|
+
module insertionGlyph;
|
|
20
|
+
|
|
21
|
+
public static const uint LONG_INSERTION_MIN_LENGTH = 10u;
|
|
22
|
+
public static const float LONG_INSERTION_TEXT_THRESHOLD_PX = 15.0;
|
|
23
|
+
public static const float INSERTION_SERIF_MIN_PX_PER_BP = 3.0;
|
|
24
|
+
public static const float MIN_HEIGHT_FOR_TEXT = 5.0;
|
|
25
|
+
public static const float SERIF_HALF_W_PX = 2.0;
|
|
26
|
+
public static const float SERIF_H_PX = 2.0;
|
|
27
|
+
|
|
28
|
+
static const float LABEL_CHAR_W = 6.0;
|
|
29
|
+
static const float LABEL_PAD = 10.0;
|
|
30
|
+
|
|
31
|
+
public float textWidth(uint num) {
|
|
32
|
+
if (num < 10u) { return LABEL_CHAR_W + LABEL_PAD; }
|
|
33
|
+
if (num < 100u) { return LABEL_CHAR_W * 2.0 + LABEL_PAD; }
|
|
34
|
+
if (num < 1000u) { return LABEL_CHAR_W * 3.0 + LABEL_PAD; }
|
|
35
|
+
if (num < 10000u) { return LABEL_CHAR_W * 4.0 + LABEL_PAD; }
|
|
36
|
+
return LABEL_CHAR_W * 5.0 + LABEL_PAD;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public float insertionBarWidthPx(uint length, float pxPerBp, float featHeight) {
|
|
40
|
+
float insWPx = float(length) * pxPerBp;
|
|
41
|
+
bool isLong = length >= LONG_INSERTION_MIN_LENGTH;
|
|
42
|
+
bool isLarge = isLong
|
|
43
|
+
&& insWPx >= LONG_INSERTION_TEXT_THRESHOLD_PX
|
|
44
|
+
&& featHeight >= MIN_HEIGHT_FOR_TEXT;
|
|
45
|
+
if (isLarge) { return textWidth(length); }
|
|
46
|
+
if (isLong) { return clamp(insWPx / 3.0, 1.0, 5.0); }
|
|
47
|
+
return 1.0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public bool insertionSerifsDraw(uint length, float pxPerBp) {
|
|
51
|
+
return length < LONG_INSERTION_MIN_LENGTH && pxPerBp >= INSERTION_SERIF_MIN_PX_PER_BP;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// A marker standing on a reference span draws only where it is wider than
|
|
55
|
+
// that span, floored at `spanFloorPx`, the narrowest the span itself paints.
|
|
56
|
+
// An interbase insertion has no span and always draws.
|
|
57
|
+
public bool insertionMarkerDraws(float barWidthPx, float spanPx, float spanFloorPx) {
|
|
58
|
+
return barWidthPx > max(spanFloorPx, abs(spanPx));
|
|
59
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// AUTO-GENERATED by packages/shader-tools/src/shader-codegen from lineCenterMark.slang.
|
|
2
2
|
// Do not edit. Run `pnpm gen:shaders` to regenerate.
|
|
3
3
|
|
|
4
|
-
export const GLSL_VERTEX = "#version 300 es\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n\n\nlayout(std140) uniform Uniforms\n{\n vec3 bpRangeX_0;\n float canvasHeight_0;\n float domainMin_0;\n float domainMax_0;\n int valueScaleType_0;\n float valueSymlogConstant_0;\n int rampMode_0;\n float rampMin_0;\n float rampMax_0;\n float rampMidNorm_0;\n int colorCutCount_0;\n vec4 colorCuts_0[2];\n vec4 colorBands_0[9];\n float rowHeight_0;\n float rowBandPx_0;\n float rowOffsetPx_0;\n float origin_0;\n float lineWidth_0;\n float zero_0;\n float viewportWidth_0;\n float devicePixelRatio_0;\n int rowTableKeys_0;\n}u_0;\n\nuniform sampler2D u_colorRamp;\n\n\nuniform sampler2D u_rowTable;\n\n\nvec4 unpackRGBA_0(uint c_0)\n{\n\n return vec4(float((c_0 >> 0U) & 255U), float((c_0 >> 8U) & 255U), float((c_0 >> 16U) & 255U), float((c_0 >> 24U) & 255U)) / 255.0;\n}\n\n\nfloat rampMidT_0(float t_0, float mid_0)\n{\n\n float _S1 = max(mid_0, 1.0 - mid_0);\n return clamp((t_0 + (_S1 - mid_0)) / (2.0 * _S1), 0.0, 1.0);\n}\n\n\nfloat colorCutAt_0(int i_0, vec4 cutsLo_0, vec4 cutsHi_0)\n{\n\n float _S2;\n if(i_0 < 4)\n {\n\n _S2 = cutsLo_0[i_0];\n\n }\n else\n {\n\n _S2 = cutsHi_0[i_0 - 4];\n\n }\n\n return _S2;\n}\n\n\nint thresholdBand_0(float value_0, int cutCount_0, vec4 cutsLo_1, vec4 cutsHi_1)\n{\n\n int band_0 = 0;\n\n int i_1 = 0;\n\n for(;;)\n {\n\n if(i_1 < cutCount_0)\n {\n }\n else\n {\n\n break;\n }\n\n if(value_0 >= (colorCutAt_0(i_1, cutsLo_1, cutsHi_1)))\n {\n\n band_0 = i_1 + 1;\n\n }\n\n i_1 = i_1 + 1;\n\n }\n\n return band_0;\n}\n\n\nfloat log1pf_0(float x_0)\n{\n\n float u_1 = 1.0 + x_0;\n\n float _S3;\n if(u_1 == 1.0)\n {\n\n _S3 = x_0;\n\n }\n else\n {\n\n _S3 = log(u_1) * (x_0 / (u_1 - 1.0));\n\n }\n\n return _S3;\n}\n\nfloat symlogTransform_0(float x_1, float c_1)\n{\n\n return float((int(sign((x_1))))) * log1pf_0(abs(x_1 / c_1));\n}\n\n\nfloat normalizeScoreUnclamped_0(float score_0, float domainMin_1, float domainMax_1, int scaleType_0, float symlogConstant_0)\n{\n\n float tMax_0;\n\n float tMin_0;\n\n float t_1;\n\n\n\n if(scaleType_0 == 2)\n {\n\n float _S4 = symlogTransform_0(score_0, symlogConstant_0);\n float _S5 = symlogTransform_0(domainMin_1, symlogConstant_0);\n\n tMax_0 = symlogTransform_0(domainMax_1, symlogConstant_0);\n\n tMin_0 = _S5;\n\n t_1 = _S4;\n\n }\n else\n {\n\n if(scaleType_0 == 1)\n {\n if(domainMin_1 > 0.0)\n {\n\n tMax_0 = domainMin_1;\n\n }\n else\n {\n\n tMax_0 = 1.0;\n\n }\n float _S6 = log2(max(score_0, tMax_0));\n float _S7 = log2(tMax_0);\n\n tMax_0 = log2(max(domainMax_1, tMax_0));\n\n tMin_0 = _S7;\n\n t_1 = _S6;\n\n }\n else\n {\n\n tMax_0 = domainMax_1;\n\n tMin_0 = domainMin_1;\n\n t_1 = score_0;\n\n }\n\n }\n\n float tRange_0 = tMax_0 - tMin_0;\n if(tRange_0 <= 0.0)\n {\n\n if(t_1 > tMin_0)\n {\n\n tMax_0 = 1.0;\n\n }\n else\n {\n\n tMax_0 = 0.0;\n\n }\n\n return tMax_0;\n }\n return (t_1 - tMin_0) / tRange_0;\n}\n\nfloat normalizeScore_0(float score_1, float domainMin_2, float domainMax_2, int scaleType_1, float symlogConstant_1)\n{\n\n return clamp(normalizeScoreUnclamped_0(score_1, domainMin_2, domainMax_2, scaleType_1, symlogConstant_1), 0.0, 1.0);\n}\n\n\nuint rowTableWidth_0(uint keys_0)\n{\n\n return max(min(keys_0, 2048U), 1U);\n}\n\nuint rowTablePlaneHeight_0(uint keys_1)\n{\n\n uint w_0 = rowTableWidth_0(keys_1);\n uint _S8 = (keys_1 + w_0 - 1U) / w_0;\n\n return max(_S8, 1U);\n}\n\nuint rowTableTexelX_0(uint key_0, uint keys_2)\n{\n\n uint _S9 = key_0 % rowTableWidth_0(keys_2);\n\n return _S9;\n}\n\n\nuint rowTableTexelY_0(uint key_1, uint keys_3)\n{\n\n uint _S10 = key_1 / rowTableWidth_0(keys_3);\n\n return _S10;\n}\n\n\nuint byteOf_0(float channel_0)\n{\n\n return uint(channel_0 * 255.0 + 0.5);\n}\n\n\nvec2 hpSplitUint_0(uint value_1)\n{\n\n uint lo_0 = value_1 & 4095U;\n\n return vec2(float(value_1 - lo_0), float(lo_0));\n}\n\n\nfloat hpToClipX_0(vec2 splitPos_0, vec3 bpRange_0, float hpZero_0)\n{\n\n float floorBp_0 = -3.00000000549775576e+38 + hpZero_0;\n float step_0 = 2.0 / bpRange_0.z;\n\n\n return dot(vec3(-1.0, max(splitPos_0.x - bpRange_0.x, floorBp_0), max(splitPos_0.y - bpRange_0.y, floorBp_0)), vec3(1.0, step_0, step_0));\n}\n\n\nfloat rowBandTopPx_0(float rowOffsetPx_1, float rowHeight_1, uint slot_0)\n{\n\n return rowOffsetPx_1 + rowHeight_1 * float(slot_0);\n}\n\n\nfloat valueToYPxScaled_0(float value_2, float domainMin_3, float domainMax_3, float h_0, int scaleType_2, float symlogConstant_2)\n{\n\n return (1.0 - normalizeScore_0(value_2, domainMin_3, domainMax_3, scaleType_2, symlogConstant_2)) * h_0;\n}\n\n\nstruct CapsuleFrame_0\n{\n vec2 tangent_0;\n vec2 normal_0;\n};\n\n\nCapsuleFrame_0 capsuleFrame_0(vec2 delta_0, float len_0)\n{\n\n CapsuleFrame_0 f_0;\n\n vec2 _S11;\n if(len_0 > 0.00009999999747379)\n {\n\n _S11 = delta_0 / len_0;\n\n }\n else\n {\n\n _S11 = vec2(1.0, 0.0);\n\n }\n\n f_0.tangent_0 = _S11;\n f_0.normal_0 = vec2(- _S11.y, _S11.x);\n return f_0;\n}\n\n\nfloat aaPx_0(float dpr_0)\n{\n\n return 1.0 / max(dpr_0, 1.0);\n}\n\n\nfloat aaHalfPx_0(float dpr_1)\n{\n\n return 0.5 * aaPx_0(dpr_1);\n}\n\n\nvec2 quadLocal_0(uint vid_0)\n{\n\n uint v_0 = vid_0 % 6U;\n\n bool _S12 = v_0 == 0U;\n\n bool _S13;\n\n if(_S12)\n {\n\n _S13 = true;\n\n }\n else\n {\n\n _S13 = v_0 == 2U;\n\n }\n\n if(_S13)\n {\n\n _S13 = true;\n\n }\n else\n {\n\n _S13 = v_0 == 3U;\n\n }\n\n float _S14;\n\n if(_S13)\n {\n\n _S14 = 0.0;\n\n }\n else\n {\n\n _S14 = 1.0;\n\n }\n if(_S12)\n {\n\n _S13 = true;\n\n }\n else\n {\n\n _S13 = v_0 == 1U;\n\n }\n\n if(_S13)\n {\n\n _S13 = true;\n\n }\n else\n {\n\n _S13 = v_0 == 4U;\n\n }\n\n float _S15;\n\n if(_S13)\n {\n\n _S15 = 0.0;\n\n }\n else\n {\n\n _S15 = 1.0;\n\n }\n\n return vec2(_S14, _S15);\n}\n\n\nvec2 capsuleQuadLocal_0(uint vid_1, float halfLenPx_0, float halfWidthPx_0, float dpr_2)\n{\n\n float ext_0 = halfWidthPx_0 + aaHalfPx_0(dpr_2);\n vec2 q_0 = quadLocal_0(vid_1) * 2.0 - 1.0;\n return vec2(q_0.x * (halfLenPx_0 + ext_0), q_0.y * ext_0);\n}\n\n\nfloat pxToClipLen_0(float px_0, float size_0)\n{\n\n return px_0 * 2.0 / size_0;\n}\n\n\nfloat yPxToClipY_0(float yPx_0, float canvasHeight_1)\n{\n\n return 1.0 - yPx_0 / canvasHeight_1 * 2.0;\n}\n\n\nflat out vec4 v_color;\n\n\nout vec2 v_localPos;\n\n\nflat out float v_segHalfLen;\n\n\nflat out vec2 v_colorLine;\n\n\nflat out vec4 v_cutYsLo;\n\n\nflat out vec4 v_cutYsHi;\n\n\nlayout(location = 0)\nin uint a_x;\n\n\nlayout(location = 1)\nin uint a_x2;\n\n\nlayout(location = 2)\nin float a_y;\n\n\nlayout(location = 3)\nin uint a_color;\n\n\nlayout(location = 4)\nin uint a_row;\n\n\nlayout(location = 5)\nin uint a_prevX;\n\n\nlayout(location = 6)\nin uint a_prevX2;\n\n\nlayout(location = 7)\nin float a_prevY;\n\n\nstruct VsOut_0\n{\n vec4 position_0;\n vec4 color_0;\n vec2 localPos_0;\n float segHalfLen_0;\n vec2 colorLine_0;\n vec4 cutYsLo_0;\n vec4 cutYsHi_0;\n};\n\n\nvec4 rampColor_0(float _S16)\n{\n\n return (textureLod((u_colorRamp), (vec2((clamp(_S16, 0.0, 1.0) * 255.0 + 0.5) / 256.0, 0.5)), (0.0)));\n}\n\n\nvec4 markScaleColor_0(uint _S17, int _S18, float _S19, float _S20, float _S21, int _S22, vec4 _S23, vec4 _S24)\n{\n\n if(_S18 == 0)\n {\n\n return unpackRGBA_0(_S17);\n }\n if(_S17 == 2143289345U)\n {\n\n return unpackRGBA_0(4289703855U);\n }\n\n int scaleType_3;\n\n if((_S17 & 2139095040U) == 2139095040U)\n {\n\n if((_S17 & 8388607U) != 0U)\n {\n\n return unpackRGBA_0(4286611584U);\n }\n\n bool negative_0 = (_S17 & 2147483648U) != 0U;\n if(_S18 == 3)\n {\n\n if(negative_0)\n {\n\n scaleType_3 = 0;\n\n }\n else\n {\n\n scaleType_3 = _S22;\n\n }\n\n return u_0.colorBands_0[scaleType_3];\n }\n\n float _S25;\n\n if(negative_0)\n {\n\n _S25 = 0.0;\n\n }\n else\n {\n\n _S25 = 1.0;\n\n }\n\n return rampColor_0(rampMidT_0(_S25, _S21));\n }\n float value_3 = uintBitsToFloat(_S17);\n if(_S18 == 3)\n {\n\n return u_0.colorBands_0[thresholdBand_0(value_3, _S22, _S23, _S24)];\n }\n if(_S18 == 2)\n {\n\n scaleType_3 = 1;\n\n }\n else\n {\n\n scaleType_3 = 0;\n\n }\n return rampColor_0(rampMidT_0(normalizeScore_0(value_3, _S19, _S20, scaleType_3, 1.0), _S21));\n}\n\n\nstruct RowPlacement_0\n{\n bool hidden_0;\n uint slot_1;\n vec4 color_1;\n};\n\n\nRowPlacement_0 rowTableLookup_0(uint _S26, int _S27, vec4 _S28)\n{\n\n RowPlacement_0 p_0;\n p_0.hidden_0 = false;\n p_0.slot_1 = _S26;\n p_0.color_1 = _S28;\n if(_S27 < 0)\n {\n\n return p_0;\n }\n uint n_0 = uint(_S27);\n if(_S26 >= n_0)\n {\n\n p_0.hidden_0 = true;\n return p_0;\n }\n uint h_1 = rowTablePlaneHeight_0(n_0);\n uint _S29 = rowTableTexelX_0(_S26, n_0);\n\n float u_2 = (float(_S29) + 0.5) / float(rowTableWidth_0(n_0));\n float rows_0 = float(2U * h_1);\n uint y_0 = rowTableTexelY_0(_S26, n_0);\n vec4 s_0 = (textureLod((u_rowTable), (vec2(u_2, (float(y_0) + 0.5) / rows_0)), (0.0)));\n if((s_0.w) < 0.5)\n {\n\n p_0.hidden_0 = true;\n return p_0;\n }\n p_0.slot_1 = ((byteOf_0(s_0.x)) | ((byteOf_0(s_0.y)) << 8)) | ((byteOf_0(s_0.z)) << 16);\n vec4 c_2 = (textureLod((u_rowTable), (vec2(u_2, (float(y_0 + h_1) + 0.5) / rows_0)), (0.0)));\n\n vec4 _S30;\n if((c_2.w) > 0.0)\n {\n\n _S30 = c_2;\n\n }\n else\n {\n\n _S30 = _S28;\n\n }\n\n p_0.color_1 = _S30;\n return p_0;\n}\n\n\nfloat lineBpToClipX_0(uint _S31)\n{\n\n return hpToClipX_0(hpSplitUint_0(_S31), u_0.bpRangeX_0, u_0.zero_0);\n}\n\n\nfloat lineValueYPx_0(float _S32, float _S33)\n{\n\n return _S33 + valueToYPxScaled_0(_S32, u_0.domainMin_0, u_0.domainMax_0, u_0.rowBandPx_0, u_0.valueScaleType_0, u_0.valueSymlogConstant_0);\n}\n\n\nfloat lineColorYPx_0(float _S34, float _S35)\n{\n\n return _S35 + (1.0 - normalizeScoreUnclamped_0(_S34, u_0.domainMin_0, u_0.domainMax_0, u_0.valueScaleType_0, u_0.valueSymlogConstant_0)) * u_0.rowBandPx_0;\n}\n\n\nvec4 lineCutYsPx_0(int _S36, float _S37)\n{\n\n vec4 ys_0 = vec4(0.0);\n\n int k_0 = 0;\n for(;;)\n {\n\n if(k_0 < 4)\n {\n }\n else\n {\n\n break;\n }\n\n int _S38 = _S36 + k_0;\n\n if(_S38 < (u_0.colorCutCount_0))\n {\n\n ys_0[k_0] = lineColorYPx_0(colorCutAt_0(_S38, u_0.colorCuts_0[0], u_0.colorCuts_0[1]), _S37);\n\n }\n\n k_0 = k_0 + 1;\n\n }\n\n return ys_0;\n}\n\n\nvoid main()\n{\n\n VsOut_0 o_0;\n\n RowPlacement_0 _S39 = rowTableLookup_0(a_row, u_0.rowTableKeys_0, markScaleColor_0(a_color, u_0.rampMode_0, u_0.rampMin_0, u_0.rampMax_0, u_0.rampMidNorm_0, u_0.colorCutCount_0, u_0.colorCuts_0[0], u_0.colorCuts_0[1]));\n\n\n if(_S39.hidden_0)\n {\n\n o_0.position_0 = vec4(2.0, 2.0, 0.0, 1.0);\n const vec4 _S40 = vec4(0.0);\n\n o_0.color_0 = _S40;\n const vec2 _S41 = vec2(0.0);\n\n o_0.localPos_0 = _S41;\n o_0.segHalfLen_0 = 0.0;\n o_0.colorLine_0 = _S41;\n o_0.cutYsLo_0 = _S40;\n o_0.cutYsHi_0 = _S40;\n VsOut_0 _S42 = o_0;\n\n gl_Position = o_0.position_0;\n\n v_color = _S42.color_0;\n\n v_localPos = _S42.localPos_0;\n\n v_segHalfLen = _S42.segHalfLen_0;\n\n v_colorLine = _S42.colorLine_0;\n\n v_cutYsLo = _S42.cutYsLo_0;\n\n v_cutYsHi = _S42.cutYsHi_0;\n\n return;\n }\n\n\n float bandTop_0 = rowBandTopPx_0(u_0.rowOffsetPx_0, u_0.rowHeight_0, _S39.slot_1);\n bool hasPrev_0 = a_prevX != 4294967295U;\n float midCurrX_0 = (lineBpToClipX_0(a_x) + lineBpToClipX_0(a_x2)) * 0.5;\n\n float midPrevX_0;\n\n\n\n if(hasPrev_0)\n {\n\n midPrevX_0 = (lineBpToClipX_0(a_prevX) + lineBpToClipX_0(a_prevX2)) * 0.5;\n\n }\n else\n {\n\n midPrevX_0 = midCurrX_0;\n\n }\n\n float _S43 = lineValueYPx_0(a_y, bandTop_0);\n\n float prevYPx_0;\n\n\n if(hasPrev_0)\n {\n\n prevYPx_0 = lineValueYPx_0(a_prevY, bandTop_0);\n\n }\n else\n {\n\n prevYPx_0 = _S43;\n\n }\n\n vec2 deltaPx_0 = vec2((midCurrX_0 - midPrevX_0) * u_0.viewportWidth_0 * 0.5, _S43 - prevYPx_0);\n\n float len_1 = length(deltaPx_0);\n CapsuleFrame_0 f_1 = capsuleFrame_0(deltaPx_0, len_1);\n\n float _S44 = len_1 * 0.5;\n\n vec2 local_0 = capsuleQuadLocal_0(uint(gl_VertexID), _S44, u_0.lineWidth_0 * 0.5, u_0.devicePixelRatio_0);\n vec2 off_0 = f_1.tangent_0 * local_0.x + f_1.normal_0 * local_0.y;\n o_0.position_0 = vec4((midPrevX_0 + midCurrX_0) * 0.5 + pxToClipLen_0(off_0.x, u_0.viewportWidth_0), yPxToClipY_0((prevYPx_0 + _S43) * 0.5 + off_0.y, u_0.canvasHeight_0), 0.0, 1.0);\n\n o_0.color_0 = _S39.color_1;\n o_0.localPos_0 = local_0;\n o_0.segHalfLen_0 = _S44;\n\n float _S45 = lineColorYPx_0(a_y, bandTop_0);\n\n float prevColorYPx_0;\n\n if(hasPrev_0)\n {\n\n prevColorYPx_0 = lineColorYPx_0(a_prevY, bandTop_0);\n\n }\n else\n {\n\n prevColorYPx_0 = _S45;\n\n }\n\n float _S46 = (prevColorYPx_0 + _S45) * 0.5;\n if(len_1 > 0.00009999999747379)\n {\n\n midPrevX_0 = (_S45 - prevColorYPx_0) / len_1;\n\n }\n else\n {\n\n midPrevX_0 = 0.0;\n\n }\n\n o_0.colorLine_0 = vec2(_S46, midPrevX_0);\n\n\n o_0.cutYsLo_0 = lineCutYsPx_0(0, bandTop_0);\n o_0.cutYsHi_0 = lineCutYsPx_0(4, bandTop_0);\n VsOut_0 _S47 = o_0;\n\n gl_Position = o_0.position_0;\n\n v_color = _S47.color_0;\n\n v_localPos = _S47.localPos_0;\n\n v_segHalfLen = _S47.segHalfLen_0;\n\n v_colorLine = _S47.colorLine_0;\n\n v_cutYsLo = _S47.cutYsLo_0;\n\n v_cutYsHi = _S47.cutYsHi_0;\n\n return;\n}\n\n"
|
|
4
|
+
export const GLSL_VERTEX = "#version 300 es\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n\n\nlayout(std140) uniform Uniforms\n{\n vec3 bpRangeX_0;\n float canvasHeight_0;\n float domainMin_0;\n float domainMax_0;\n int valueScaleType_0;\n float valueSymlogConstant_0;\n int rampMode_0;\n float rampMin_0;\n float rampMax_0;\n float rampMidNorm_0;\n int colorCutCount_0;\n vec4 colorCuts_0[2];\n vec4 colorBands_0[9];\n int colorFromY_0;\n float rowHeight_0;\n float rowBandPx_0;\n float rowOffsetPx_0;\n float origin_0;\n float lineWidth_0;\n float zero_0;\n float viewportWidth_0;\n float devicePixelRatio_0;\n int rowTableKeys_0;\n}u_0;\n\nuniform sampler2D u_colorRamp;\n\n\nuniform sampler2D u_rowTable;\n\n\nvec4 unpackRGBA_0(uint c_0)\n{\n\n return vec4(float((c_0 >> 0U) & 255U), float((c_0 >> 8U) & 255U), float((c_0 >> 16U) & 255U), float((c_0 >> 24U) & 255U)) / 255.0;\n}\n\n\nfloat rampMidT_0(float t_0, float mid_0)\n{\n\n float _S1 = max(mid_0, 1.0 - mid_0);\n return clamp((t_0 + (_S1 - mid_0)) / (2.0 * _S1), 0.0, 1.0);\n}\n\n\nfloat colorCutAt_0(int i_0, vec4 cutsLo_0, vec4 cutsHi_0)\n{\n\n float _S2;\n if(i_0 < 4)\n {\n\n _S2 = cutsLo_0[i_0];\n\n }\n else\n {\n\n _S2 = cutsHi_0[i_0 - 4];\n\n }\n\n return _S2;\n}\n\n\nint thresholdBand_0(float value_0, int cutCount_0, vec4 cutsLo_1, vec4 cutsHi_1)\n{\n\n int band_0 = 0;\n\n int i_1 = 0;\n\n for(;;)\n {\n\n if(i_1 < cutCount_0)\n {\n }\n else\n {\n\n break;\n }\n\n if(value_0 >= (colorCutAt_0(i_1, cutsLo_1, cutsHi_1)))\n {\n\n band_0 = i_1 + 1;\n\n }\n\n i_1 = i_1 + 1;\n\n }\n\n return band_0;\n}\n\n\nfloat log1pf_0(float x_0)\n{\n\n float u_1 = 1.0 + x_0;\n\n float _S3;\n if(u_1 == 1.0)\n {\n\n _S3 = x_0;\n\n }\n else\n {\n\n _S3 = log(u_1) * (x_0 / (u_1 - 1.0));\n\n }\n\n return _S3;\n}\n\nfloat symlogTransform_0(float x_1, float c_1)\n{\n\n return float((int(sign((x_1))))) * log1pf_0(abs(x_1 / c_1));\n}\n\n\nfloat normalizeScoreUnclamped_0(float score_0, float domainMin_1, float domainMax_1, int scaleType_0, float symlogConstant_0)\n{\n\n float tMax_0;\n\n float tMin_0;\n\n float t_1;\n\n\n\n if(scaleType_0 == 2)\n {\n\n float _S4 = symlogTransform_0(score_0, symlogConstant_0);\n float _S5 = symlogTransform_0(domainMin_1, symlogConstant_0);\n\n tMax_0 = symlogTransform_0(domainMax_1, symlogConstant_0);\n\n tMin_0 = _S5;\n\n t_1 = _S4;\n\n }\n else\n {\n\n if(scaleType_0 == 1)\n {\n if(domainMin_1 > 0.0)\n {\n\n tMax_0 = domainMin_1;\n\n }\n else\n {\n\n tMax_0 = 1.0;\n\n }\n float _S6 = log2(max(score_0, tMax_0));\n float _S7 = log2(tMax_0);\n\n tMax_0 = log2(max(domainMax_1, tMax_0));\n\n tMin_0 = _S7;\n\n t_1 = _S6;\n\n }\n else\n {\n\n tMax_0 = domainMax_1;\n\n tMin_0 = domainMin_1;\n\n t_1 = score_0;\n\n }\n\n }\n\n float tRange_0 = tMax_0 - tMin_0;\n if(tRange_0 <= 0.0)\n {\n\n if(t_1 > tMin_0)\n {\n\n tMax_0 = 1.0;\n\n }\n else\n {\n\n tMax_0 = 0.0;\n\n }\n\n return tMax_0;\n }\n return (t_1 - tMin_0) / tRange_0;\n}\n\nfloat normalizeScore_0(float score_1, float domainMin_2, float domainMax_2, int scaleType_1, float symlogConstant_1)\n{\n\n return clamp(normalizeScoreUnclamped_0(score_1, domainMin_2, domainMax_2, scaleType_1, symlogConstant_1), 0.0, 1.0);\n}\n\n\nuint rowTableWidth_0(uint keys_0)\n{\n\n return max(min(keys_0, 2048U), 1U);\n}\n\nuint rowTablePlaneHeight_0(uint keys_1)\n{\n\n uint w_0 = rowTableWidth_0(keys_1);\n uint _S8 = (keys_1 + w_0 - 1U) / w_0;\n\n return max(_S8, 1U);\n}\n\nuint rowTableTexelX_0(uint key_0, uint keys_2)\n{\n\n uint _S9 = key_0 % rowTableWidth_0(keys_2);\n\n return _S9;\n}\n\n\nuint rowTableTexelY_0(uint key_1, uint keys_3)\n{\n\n uint _S10 = key_1 / rowTableWidth_0(keys_3);\n\n return _S10;\n}\n\n\nuint byteOf_0(float channel_0)\n{\n\n return uint(channel_0 * 255.0 + 0.5);\n}\n\n\nvec2 hpSplitUint_0(uint value_1)\n{\n\n uint lo_0 = value_1 & 4095U;\n\n return vec2(float(value_1 - lo_0), float(lo_0));\n}\n\n\nfloat hpToClipX_0(vec2 splitPos_0, vec3 bpRange_0, float hpZero_0)\n{\n\n float floorBp_0 = -3.00000000549775576e+38 + hpZero_0;\n float step_0 = 2.0 / bpRange_0.z;\n\n\n return dot(vec3(-1.0, max(splitPos_0.x - bpRange_0.x, floorBp_0), max(splitPos_0.y - bpRange_0.y, floorBp_0)), vec3(1.0, step_0, step_0));\n}\n\n\nfloat rowBandTopPx_0(float rowOffsetPx_1, float rowHeight_1, uint slot_0)\n{\n\n return rowOffsetPx_1 + rowHeight_1 * float(slot_0);\n}\n\n\nfloat valueToYPxScaled_0(float value_2, float domainMin_3, float domainMax_3, float h_0, int scaleType_2, float symlogConstant_2)\n{\n\n return (1.0 - normalizeScore_0(value_2, domainMin_3, domainMax_3, scaleType_2, symlogConstant_2)) * h_0;\n}\n\n\nfloat aaPx_0(float dpr_0)\n{\n\n return 1.0 / max(dpr_0, 1.0);\n}\n\n\nfloat aaHalfPx_0(float dpr_1)\n{\n\n return 0.5 * aaPx_0(dpr_1);\n}\n\n\nstruct CapsuleFrame_0\n{\n vec2 tangent_0;\n vec2 normal_0;\n};\n\n\nCapsuleFrame_0 capsuleFrame_0(vec2 delta_0, float len_0)\n{\n\n CapsuleFrame_0 f_0;\n\n vec2 _S11;\n if(len_0 > 0.00009999999747379)\n {\n\n _S11 = delta_0 / len_0;\n\n }\n else\n {\n\n _S11 = vec2(1.0, 0.0);\n\n }\n\n f_0.tangent_0 = _S11;\n f_0.normal_0 = vec2(- _S11.y, _S11.x);\n return f_0;\n}\n\n\nvec2 quadLocal_0(uint vid_0)\n{\n\n uint v_0 = vid_0 % 6U;\n\n bool _S12 = v_0 == 0U;\n\n bool _S13;\n\n if(_S12)\n {\n\n _S13 = true;\n\n }\n else\n {\n\n _S13 = v_0 == 2U;\n\n }\n\n if(_S13)\n {\n\n _S13 = true;\n\n }\n else\n {\n\n _S13 = v_0 == 3U;\n\n }\n\n float _S14;\n\n if(_S13)\n {\n\n _S14 = 0.0;\n\n }\n else\n {\n\n _S14 = 1.0;\n\n }\n if(_S12)\n {\n\n _S13 = true;\n\n }\n else\n {\n\n _S13 = v_0 == 1U;\n\n }\n\n if(_S13)\n {\n\n _S13 = true;\n\n }\n else\n {\n\n _S13 = v_0 == 4U;\n\n }\n\n float _S15;\n\n if(_S13)\n {\n\n _S15 = 0.0;\n\n }\n else\n {\n\n _S15 = 1.0;\n\n }\n\n return vec2(_S14, _S15);\n}\n\n\nstruct SegmentCorner_0\n{\n bool atEnd_0;\n vec2 offsetPx_0;\n vec3 local_0;\n};\n\n\nSegmentCorner_0 segmentCorner_0(uint vid_1, vec2 deltaPx_0, float alongPadPx_0, float acrossPadPx_0)\n{\n\n float len_1 = length(deltaPx_0);\n CapsuleFrame_0 f_1 = capsuleFrame_0(deltaPx_0, len_1);\n vec2 q_0 = quadLocal_0(vid_1) * 2.0 - 1.0;\n float across_0 = q_0.y * acrossPadPx_0;\n SegmentCorner_0 c_2;\n float _S16 = q_0.x;\n\n bool _S17 = _S16 > 0.0;\n\n c_2.atEnd_0 = _S17;\n c_2.offsetPx_0 = f_1.tangent_0 * (_S16 * alongPadPx_0) + f_1.normal_0 * across_0;\n float far_0 = len_1 + alongPadPx_0;\n\n vec3 _S18;\n\n if(_S17)\n {\n\n _S18 = vec3(far_0, - alongPadPx_0, across_0);\n\n }\n else\n {\n\n _S18 = vec3(- alongPadPx_0, far_0, across_0);\n\n }\n\n c_2.local_0 = _S18;\n\n\n return c_2;\n}\n\n\n\nSegmentCorner_0 capsuleCorner_0(uint vid_2, vec2 deltaPx_1, float halfWidthPx_0, float dpr_2)\n{\n\n float ext_0 = halfWidthPx_0 + aaHalfPx_0(dpr_2);\n return segmentCorner_0(vid_2, deltaPx_1, ext_0, ext_0);\n}\n\n\nfloat pxToClipLen_0(float px_0, float size_0)\n{\n\n return px_0 * 2.0 / size_0;\n}\n\n\nfloat yPxToClipY_0(float yPx_0, float canvasHeight_1)\n{\n\n return 1.0 - yPx_0 / canvasHeight_1 * 2.0;\n}\n\n\nbool lineColorAlongY_0(int rampMode_1, int colorFromY_1, bool overridden_0)\n{\n\n bool _S19;\n if(rampMode_1 == 3)\n {\n\n _S19 = colorFromY_1 != 0;\n\n }\n else\n {\n\n _S19 = false;\n\n }\n\n if(_S19)\n {\n\n _S19 = !overridden_0;\n\n }\n else\n {\n\n _S19 = false;\n\n }\n\n return _S19;\n}\n\n\nflat out vec4 v_color;\n\n\nout vec3 v_localPos;\n\n\nflat out vec2 v_colorLine;\n\n\nflat out vec4 v_cutYsLo;\n\n\nflat out vec4 v_cutYsHi;\n\n\nflat out float v_colorAlongY;\n\n\nlayout(location = 0)\nin uint a_x;\n\n\nlayout(location = 1)\nin uint a_x2;\n\n\nlayout(location = 2)\nin float a_y;\n\n\nlayout(location = 3)\nin uint a_color;\n\n\nlayout(location = 4)\nin uint a_row;\n\n\nlayout(location = 5)\nin uint a_prevX;\n\n\nlayout(location = 6)\nin uint a_prevX2;\n\n\nlayout(location = 7)\nin float a_prevY;\n\n\nstruct VsOut_0\n{\n vec4 position_0;\n vec4 color_0;\n vec3 localPos_0;\n vec2 colorLine_0;\n vec4 cutYsLo_0;\n vec4 cutYsHi_0;\n float colorAlongY_0;\n};\n\n\nvec4 rampColor_0(float _S20)\n{\n\n return (textureLod((u_colorRamp), (vec2((clamp(_S20, 0.0, 1.0) * 255.0 + 0.5) / 256.0, 0.5)), (0.0)));\n}\n\n\nvec4 markScaleColor_0(uint _S21, int _S22, float _S23, float _S24, float _S25, int _S26, vec4 _S27, vec4 _S28)\n{\n\n if(_S22 == 0)\n {\n\n return unpackRGBA_0(_S21);\n }\n if(_S21 == 2143289345U)\n {\n\n return unpackRGBA_0(4289703855U);\n }\n\n int scaleType_3;\n\n if((_S21 & 2139095040U) == 2139095040U)\n {\n\n if((_S21 & 8388607U) != 0U)\n {\n\n return unpackRGBA_0(4286611584U);\n }\n\n bool negative_0 = (_S21 & 2147483648U) != 0U;\n if(_S22 == 3)\n {\n\n if(negative_0)\n {\n\n scaleType_3 = 0;\n\n }\n else\n {\n\n scaleType_3 = _S26;\n\n }\n\n return u_0.colorBands_0[scaleType_3];\n }\n\n float _S29;\n\n if(negative_0)\n {\n\n _S29 = 0.0;\n\n }\n else\n {\n\n _S29 = 1.0;\n\n }\n\n return rampColor_0(rampMidT_0(_S29, _S25));\n }\n float value_3 = uintBitsToFloat(_S21);\n if(_S22 == 3)\n {\n\n return u_0.colorBands_0[thresholdBand_0(value_3, _S26, _S27, _S28)];\n }\n if(_S22 == 2)\n {\n\n scaleType_3 = 1;\n\n }\n else\n {\n\n scaleType_3 = 0;\n\n }\n return rampColor_0(rampMidT_0(normalizeScore_0(value_3, _S23, _S24, scaleType_3, 1.0), _S25));\n}\n\n\nstruct RowPlacement_0\n{\n bool hidden_0;\n uint slot_1;\n vec4 color_1;\n bool overridden_1;\n};\n\n\nRowPlacement_0 rowTableLookup_0(uint _S30, int _S31, vec4 _S32)\n{\n\n RowPlacement_0 p_0;\n p_0.hidden_0 = false;\n p_0.slot_1 = _S30;\n p_0.color_1 = _S32;\n p_0.overridden_1 = false;\n if(_S31 < 0)\n {\n\n return p_0;\n }\n uint n_0 = uint(_S31);\n if(_S30 >= n_0)\n {\n\n p_0.hidden_0 = true;\n return p_0;\n }\n uint h_1 = rowTablePlaneHeight_0(n_0);\n uint _S33 = rowTableTexelX_0(_S30, n_0);\n\n float u_2 = (float(_S33) + 0.5) / float(rowTableWidth_0(n_0));\n float rows_0 = float(2U * h_1);\n uint y_0 = rowTableTexelY_0(_S30, n_0);\n vec4 s_0 = (textureLod((u_rowTable), (vec2(u_2, (float(y_0) + 0.5) / rows_0)), (0.0)));\n if((s_0.w) < 0.5)\n {\n\n p_0.hidden_0 = true;\n return p_0;\n }\n p_0.slot_1 = ((byteOf_0(s_0.x)) | ((byteOf_0(s_0.y)) << 8)) | ((byteOf_0(s_0.z)) << 16);\n vec4 c_3 = (textureLod((u_rowTable), (vec2(u_2, (float(y_0 + h_1) + 0.5) / rows_0)), (0.0)));\n bool _S34 = (c_3.w) > 0.0;\n\n p_0.overridden_1 = _S34;\n\n vec4 _S35;\n if(_S34)\n {\n\n _S35 = c_3;\n\n }\n else\n {\n\n _S35 = _S32;\n\n }\n\n p_0.color_1 = _S35;\n return p_0;\n}\n\n\nfloat lineBpToClipX_0(uint _S36)\n{\n\n return hpToClipX_0(hpSplitUint_0(_S36), u_0.bpRangeX_0, u_0.zero_0);\n}\n\n\nfloat lineValueYPx_0(float _S37, float _S38)\n{\n\n return _S38 + valueToYPxScaled_0(_S37, u_0.domainMin_0, u_0.domainMax_0, u_0.rowBandPx_0, u_0.valueScaleType_0, u_0.valueSymlogConstant_0);\n}\n\n\nfloat lineColorYPx_0(float _S39, float _S40)\n{\n\n return _S40 + (1.0 - normalizeScoreUnclamped_0(_S39, u_0.domainMin_0, u_0.domainMax_0, u_0.valueScaleType_0, u_0.valueSymlogConstant_0)) * u_0.rowBandPx_0;\n}\n\n\nvec4 lineCutYsPx_0(int _S41, float _S42)\n{\n\n vec4 ys_0 = vec4(0.0);\n\n int k_0 = 0;\n for(;;)\n {\n\n if(k_0 < 4)\n {\n }\n else\n {\n\n break;\n }\n\n int _S43 = _S41 + k_0;\n\n if(_S43 < (u_0.colorCutCount_0))\n {\n\n ys_0[k_0] = lineColorYPx_0(colorCutAt_0(_S43, u_0.colorCuts_0[0], u_0.colorCuts_0[1]), _S42);\n\n }\n\n k_0 = k_0 + 1;\n\n }\n\n return ys_0;\n}\n\n\nvoid main()\n{\n\n VsOut_0 o_0;\n\n RowPlacement_0 _S44 = rowTableLookup_0(a_row, u_0.rowTableKeys_0, markScaleColor_0(a_color, u_0.rampMode_0, u_0.rampMin_0, u_0.rampMax_0, u_0.rampMidNorm_0, u_0.colorCutCount_0, u_0.colorCuts_0[0], u_0.colorCuts_0[1]));\n\n\n if(_S44.hidden_0)\n {\n\n o_0.position_0 = vec4(2.0, 2.0, 0.0, 1.0);\n const vec4 _S45 = vec4(0.0);\n\n o_0.color_0 = _S45;\n o_0.localPos_0 = vec3(0.0);\n o_0.colorLine_0 = vec2(0.0);\n o_0.cutYsLo_0 = _S45;\n o_0.cutYsHi_0 = _S45;\n o_0.colorAlongY_0 = 0.0;\n VsOut_0 _S46 = o_0;\n\n gl_Position = o_0.position_0;\n\n v_color = _S46.color_0;\n\n v_localPos = _S46.localPos_0;\n\n v_colorLine = _S46.colorLine_0;\n\n v_cutYsLo = _S46.cutYsLo_0;\n\n v_cutYsHi = _S46.cutYsHi_0;\n\n v_colorAlongY = _S46.colorAlongY_0;\n\n return;\n }\n\n\n float bandTop_0 = rowBandTopPx_0(u_0.rowOffsetPx_0, u_0.rowHeight_0, _S44.slot_1);\n bool hasPrev_0 = a_prevX != 4294967295U;\n float midCurrX_0 = (lineBpToClipX_0(a_x) + lineBpToClipX_0(a_x2)) * 0.5;\n\n float midPrevX_0;\n\n\n\n if(hasPrev_0)\n {\n\n midPrevX_0 = (lineBpToClipX_0(a_prevX) + lineBpToClipX_0(a_prevX2)) * 0.5;\n\n }\n else\n {\n\n midPrevX_0 = midCurrX_0;\n\n }\n\n float _S47 = lineValueYPx_0(a_y, bandTop_0);\n\n float prevYPx_0;\n\n\n if(hasPrev_0)\n {\n\n prevYPx_0 = lineValueYPx_0(a_prevY, bandTop_0);\n\n }\n else\n {\n\n prevYPx_0 = _S47;\n\n }\n\n\n vec2 deltaPx_2 = vec2((midCurrX_0 - midPrevX_0) * u_0.viewportWidth_0 * 0.5, _S47 - prevYPx_0);\n\n float len_2 = length(deltaPx_2);\n\n SegmentCorner_0 c_4 = capsuleCorner_0(uint(gl_VertexID), deltaPx_2, u_0.lineWidth_0 * 0.5, u_0.devicePixelRatio_0);\n\n if(c_4.atEnd_0)\n {\n\n midPrevX_0 = midCurrX_0;\n\n }\n\n float _S48 = midPrevX_0 + pxToClipLen_0(c_4.offsetPx_0.x, u_0.viewportWidth_0);\n if(c_4.atEnd_0)\n {\n\n midPrevX_0 = _S47;\n\n }\n else\n {\n\n midPrevX_0 = prevYPx_0;\n\n }\n\n o_0.position_0 = vec4(_S48, yPxToClipY_0(midPrevX_0 + c_4.offsetPx_0.y, u_0.canvasHeight_0), 0.0, 1.0);\n\n o_0.color_0 = _S44.color_1;\n o_0.localPos_0 = c_4.local_0;\n\n float _S49 = lineColorYPx_0(a_y, bandTop_0);\n\n float prevColorYPx_0;\n\n if(hasPrev_0)\n {\n\n prevColorYPx_0 = lineColorYPx_0(a_prevY, bandTop_0);\n\n }\n else\n {\n\n prevColorYPx_0 = _S49;\n\n }\n\n\n if(len_2 > 0.00009999999747379)\n {\n\n midPrevX_0 = (_S49 - prevColorYPx_0) / len_2;\n\n }\n else\n {\n\n midPrevX_0 = 0.0;\n\n }\n\n o_0.colorLine_0 = vec2(prevColorYPx_0, midPrevX_0);\n\n\n o_0.cutYsLo_0 = lineCutYsPx_0(0, bandTop_0);\n o_0.cutYsHi_0 = lineCutYsPx_0(4, bandTop_0);\n\n if(lineColorAlongY_0(u_0.rampMode_0, u_0.colorFromY_0, _S44.overridden_1))\n {\n\n midPrevX_0 = 1.0;\n\n }\n else\n {\n\n midPrevX_0 = 0.0;\n\n }\n\n o_0.colorAlongY_0 = midPrevX_0;\n\n VsOut_0 _S50 = o_0;\n\n gl_Position = o_0.position_0;\n\n v_color = _S50.color_0;\n\n v_localPos = _S50.localPos_0;\n\n v_colorLine = _S50.colorLine_0;\n\n v_cutYsLo = _S50.cutYsLo_0;\n\n v_cutYsHi = _S50.cutYsHi_0;\n\n v_colorAlongY = _S50.colorAlongY_0;\n\n return;\n}\n\n"
|
|
5
5
|
|
|
6
|
-
export const GLSL_FRAGMENT = "#version 300 es\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n\n\nlayout(std140) uniform Uniforms\n{\n vec3 bpRangeX_0;\n float canvasHeight_0;\n float domainMin_0;\n float domainMax_0;\n int valueScaleType_0;\n float valueSymlogConstant_0;\n int rampMode_0;\n float rampMin_0;\n float rampMax_0;\n float rampMidNorm_0;\n int colorCutCount_0;\n vec4 colorCuts_0[2];\n vec4 colorBands_0[9];\n float rowHeight_0;\n float rowBandPx_0;\n float rowOffsetPx_0;\n float origin_0;\n float lineWidth_0;\n float zero_0;\n float viewportWidth_0;\n float devicePixelRatio_0;\n int rowTableKeys_0;\n}u_0;\n\nfloat capsuleDistPx_0(float
|
|
6
|
+
export const GLSL_FRAGMENT = "#version 300 es\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n\n\nlayout(std140) uniform Uniforms\n{\n vec3 bpRangeX_0;\n float canvasHeight_0;\n float domainMin_0;\n float domainMax_0;\n int valueScaleType_0;\n float valueSymlogConstant_0;\n int rampMode_0;\n float rampMin_0;\n float rampMax_0;\n float rampMidNorm_0;\n int colorCutCount_0;\n vec4 colorCuts_0[2];\n vec4 colorBands_0[9];\n int colorFromY_0;\n float rowHeight_0;\n float rowBandPx_0;\n float rowOffsetPx_0;\n float origin_0;\n float lineWidth_0;\n float zero_0;\n float viewportWidth_0;\n float devicePixelRatio_0;\n int rowTableKeys_0;\n}u_0;\n\nfloat capsuleDistPx_0(float fromStartPx_0, float fromEndPx_0, float acrossPx_0)\n{\n\n float _S1 = max(max(- fromStartPx_0, - fromEndPx_0), 0.0);\n return sqrt(_S1 * _S1 + acrossPx_0 * acrossPx_0);\n}\n\nfloat capsuleDist_0(vec3 local_0)\n{\n\n return capsuleDistPx_0(local_0.x, local_0.y, local_0.z);\n}\n\n\nfloat aaPx_0(float dpr_0)\n{\n\n return 1.0 / max(dpr_0, 1.0);\n}\n\n\nfloat aaRamp_0(float signedInk_0, float widthPx_0)\n{\n\n return clamp(signedInk_0 / widthPx_0 + 0.5, 0.0, 1.0);\n}\n\n\nfloat edgeCoverage_0(float signedInkCssPx_0, float dpr_1)\n{\n\n return aaRamp_0(signedInkCssPx_0, aaPx_0(dpr_1));\n}\n\n\nfloat colorCutAt_0(int i_0, vec4 cutsLo_0, vec4 cutsHi_0)\n{\n\n float _S2;\n if(i_0 < 4)\n {\n\n _S2 = cutsLo_0[i_0];\n\n }\n else\n {\n\n _S2 = cutsHi_0[i_0 - 4];\n\n }\n\n return _S2;\n}\n\n\nint thresholdBandAtYPx_0(float yPx_0, int cutCount_0, vec4 cutYsLo_0, vec4 cutYsHi_0)\n{\n\n int band_0 = 0;\n\n int i_1 = 0;\n\n for(;;)\n {\n\n if(i_1 < cutCount_0)\n {\n }\n else\n {\n\n break;\n }\n\n if(yPx_0 <= (colorCutAt_0(i_1, cutYsLo_0, cutYsHi_0)))\n {\n\n band_0 = i_1 + 1;\n\n }\n\n i_1 = i_1 + 1;\n\n }\n\n return band_0;\n}\n\n\nlayout(location = 0)\nout vec4 entryPointParam_fs_main_0;\n\n\nflat in vec4 v_color;\n\n\nin vec3 v_localPos;\n\n\nflat in vec2 v_colorLine;\n\n\nflat in vec4 v_cutYsLo;\n\n\nflat in vec4 v_cutYsHi;\n\n\nflat in float v_colorAlongY;\n\n\nvec4 lineFragmentColor_0(float _S3, vec4 _S4, vec4 _S5, vec4 _S6, float _S7)\n{\n\n if(_S7 < 0.5)\n {\n\n return _S6;\n }\n return u_0.colorBands_0[thresholdBandAtYPx_0(_S3, u_0.colorCutCount_0, _S4, _S5)];\n}\n\n\nvoid main()\n{\n float alpha_0 = edgeCoverage_0(u_0.lineWidth_0 * 0.5 - capsuleDist_0(v_localPos), u_0.devicePixelRatio_0);\n if(alpha_0 <= 0.0)\n {\n\n discard;\n\n }\n\n vec4 _S8 = lineFragmentColor_0(v_colorLine.x + v_colorLine.y * clamp(v_localPos.x, 0.0, v_localPos.x + v_localPos.y), v_cutYsLo, v_cutYsHi, v_color, v_colorAlongY);\n\n entryPointParam_fs_main_0 = vec4(_S8.xyz * alpha_0, _S8.w * alpha_0);\n\n return;\n}\n\n"
|
|
@@ -29,14 +29,14 @@ export const UNIFORM_OFFSET_F32 = {
|
|
|
29
29
|
rampMin: 9,
|
|
30
30
|
rampMax: 10,
|
|
31
31
|
rampMidNorm: 11,
|
|
32
|
-
rowHeight:
|
|
33
|
-
rowBandPx:
|
|
34
|
-
rowOffsetPx:
|
|
35
|
-
origin:
|
|
36
|
-
lineWidth:
|
|
37
|
-
zero:
|
|
38
|
-
viewportWidth:
|
|
39
|
-
devicePixelRatio:
|
|
32
|
+
rowHeight: 61,
|
|
33
|
+
rowBandPx: 62,
|
|
34
|
+
rowOffsetPx: 63,
|
|
35
|
+
origin: 64,
|
|
36
|
+
lineWidth: 65,
|
|
37
|
+
zero: 66,
|
|
38
|
+
viewportWidth: 67,
|
|
39
|
+
devicePixelRatio: 68,
|
|
40
40
|
} as const
|
|
41
41
|
|
|
42
42
|
// Word indices into a Int32Array view over the uniform buffer.
|
|
@@ -44,7 +44,8 @@ export const UNIFORM_OFFSET_I32 = {
|
|
|
44
44
|
valueScaleType: 6,
|
|
45
45
|
rampMode: 8,
|
|
46
46
|
colorCutCount: 12,
|
|
47
|
-
|
|
47
|
+
colorFromY: 60,
|
|
48
|
+
rowTableKeys: 69,
|
|
48
49
|
} as const
|
|
49
50
|
|
|
50
51
|
|
|
@@ -104,6 +105,7 @@ export interface Uniforms {
|
|
|
104
105
|
colorCutCount: number
|
|
105
106
|
colorCuts: [[number, number, number, number], [number, number, number, number]]
|
|
106
107
|
colorBands: [[number, number, number, number], [number, number, number, number], [number, number, number, number], [number, number, number, number], [number, number, number, number], [number, number, number, number], [number, number, number, number], [number, number, number, number], [number, number, number, number]]
|
|
108
|
+
colorFromY: number
|
|
107
109
|
rowHeight: number
|
|
108
110
|
rowBandPx: number
|
|
109
111
|
rowOffsetPx: number
|
|
@@ -175,15 +177,16 @@ export function writeUniforms(buf: ArrayBuffer, uniforms: Uniforms) {
|
|
|
175
177
|
f32[57] = uniforms.colorBands[8][1]
|
|
176
178
|
f32[58] = uniforms.colorBands[8][2]
|
|
177
179
|
f32[59] = uniforms.colorBands[8][3]
|
|
178
|
-
|
|
179
|
-
f32[61] = uniforms.
|
|
180
|
-
f32[62] = uniforms.
|
|
181
|
-
f32[63] = uniforms.
|
|
182
|
-
f32[64] = uniforms.
|
|
183
|
-
f32[65] = uniforms.
|
|
184
|
-
f32[66] = uniforms.
|
|
185
|
-
f32[67] = uniforms.
|
|
186
|
-
|
|
180
|
+
i32[60] = uniforms.colorFromY
|
|
181
|
+
f32[61] = uniforms.rowHeight
|
|
182
|
+
f32[62] = uniforms.rowBandPx
|
|
183
|
+
f32[63] = uniforms.rowOffsetPx
|
|
184
|
+
f32[64] = uniforms.origin
|
|
185
|
+
f32[65] = uniforms.lineWidth
|
|
186
|
+
f32[66] = uniforms.zero
|
|
187
|
+
f32[67] = uniforms.viewportWidth
|
|
188
|
+
f32[68] = uniforms.devicePixelRatio
|
|
189
|
+
i32[69] = uniforms.rowTableKeys
|
|
187
190
|
}
|
|
188
191
|
|
|
189
192
|
export const INSTANCE_STRIDE_BYTES = 32
|