@tinyweb_dev/agent-framework-chat-ui 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@tinyweb_dev/agent-framework-chat-ui",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "sideEffects": [
@@ -28,8 +28,8 @@
28
28
  "react-dom": ">=19.0.0",
29
29
  "three": ">=0.160.0",
30
30
  "@react-three/fiber": ">=8.16.0 || >=9.0.0",
31
- "@tinyweb_dev/agent-framework-protocol": "0.1.0",
32
- "@tinyweb_dev/agent-framework-realtime": "0.1.0"
31
+ "@tinyweb_dev/agent-framework-protocol": "0.1.1",
32
+ "@tinyweb_dev/agent-framework-realtime": "0.1.1"
33
33
  },
34
34
  "peerDependenciesMeta": {
35
35
  "@tinyweb-agent-framework/realtime": {
@@ -55,7 +55,7 @@
55
55
  "react-dom": "19.0.0",
56
56
  "three": "0.184.0",
57
57
  "typescript": "5.8.2",
58
- "@tinyweb_dev/agent-framework-protocol": "0.1.0",
59
- "@tinyweb_dev/agent-framework-realtime": "0.1.0"
58
+ "@tinyweb_dev/agent-framework-protocol": "0.1.1",
59
+ "@tinyweb_dev/agent-framework-realtime": "0.1.1"
60
60
  }
61
61
  }
@@ -174,6 +174,7 @@ void main(){
174
174
  const DUST_VERT = /* glsl */ `
175
175
  ${NOISE_GLSL}
176
176
  ${STATE_UNIFORMS}
177
+ uniform float uResHeight;
177
178
  attribute float aSize;
178
179
  attribute float aOffset;
179
180
  attribute float aPhase;
@@ -232,7 +233,17 @@ void main(){
232
233
 
233
234
  vec4 mv = modelViewMatrix * vec4(np, 1.0);
234
235
  gl_Position = projectionMatrix * mv;
235
- gl_PointSize = aSize * boost * (140.0 / -mv.z);
236
+ // Point size is normalised by canvas height (uResHeight) against a 680px
237
+ // reference (the orb max CSS size) and then hard-clamped. Without the
238
+ // normalisation the raw 140.0 / -mv.z term yields a fixed pixel size
239
+ // regardless of resolution, so on large / high-DPI canvases the additive
240
+ // dust points overlap far more per output pixel and bloom into a blown-out
241
+ // glare. Normalising + clamping keeps the dust coverage — and therefore the
242
+ // additive brightness — visually constant on every screen. This is the only
243
+ // change needed for the large-screen blow-out; density/alpha stay original.
244
+ float sizeScale = uResHeight / 680.0;
245
+ float ps = aSize * boost * (140.0 / -mv.z) * sizeScale;
246
+ gl_PointSize = clamp(ps, 1.0, 12.0);
236
247
 
237
248
  vAlpha = 1.0 - aOffset * 0.5;
238
249
  vBoost = boost;
@@ -354,6 +365,7 @@ export const WireOrbEffect = (props: WireOrbEffectProps) => {
354
365
  uMouseStrength: sharedUniforms.uMouseStrength,
355
366
  uColor: { value: new THREE.Color().fromArray(COLOR_MONO) },
356
367
  uIntensity: { value: 0.65 },
368
+ uResHeight: { value: H },
357
369
  }
358
370
  const dustMat = new THREE.ShaderMaterial({
359
371
  vertexShader: DUST_VERT,
@@ -511,6 +523,9 @@ export const WireOrbEffect = (props: WireOrbEffectProps) => {
511
523
  renderer.setSize(Wn, Hn)
512
524
  cam.aspect = Wn / Hn
513
525
  cam.updateProjectionMatrix()
526
+ // Keep dust point-size coverage constant across screen sizes; see the
527
+ // comment in DUST_VERT. uResHeight tracks the CSS height of the canvas.
528
+ dustUniforms.uResHeight.value = Hn
514
529
  }
515
530
  window.addEventListener("resize", onResize)
516
531
  const ro = new ResizeObserver(onResize)