vim-web 0.6.0-dev.8 → 0.6.0-dev.9

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.
@@ -54059,8 +54059,8 @@ void main() {
54059
54059
  clipping: true,
54060
54060
  // Use GLSL ES 3.0 for WebGL 2
54061
54061
  glslVersion: GLSL3,
54062
- // Only write depth, not color (outline shader only reads depth)
54063
- colorWrite: false,
54062
+ // Writes 1.0 to color for selected, 0.0 for background (after clear).
54063
+ // Outline shader does edge detection on this binary mask.
54064
54064
  vertexShader: (
54065
54065
  /* glsl */
54066
54066
  `
@@ -54351,51 +54351,38 @@ void main() {
54351
54351
  }
54352
54352
  `,
54353
54353
  fragmentShader: `
54354
- #include <packing>
54355
-
54356
- uniform sampler2D depthBuffer;
54357
- uniform float cameraNear;
54358
- uniform float cameraFar;
54354
+ uniform sampler2D sceneBuffer;
54359
54355
  uniform vec4 screenSize;
54360
- uniform vec3 outlineColor;
54361
54356
  uniform float intensity;
54362
54357
 
54363
54358
  in vec2 vUv;
54364
54359
  out vec4 fragColor;
54365
54360
 
54366
- // Use texelFetch for faster indexed access (WebGL 2)
54367
- float getPixelDepth(int x, int y) {
54361
+ // Read binary selection mask: 1.0 = selected, 0.0 = background.
54362
+ // Clamp to texture bounds so edge pixels don't read out-of-bounds
54363
+ // (which returns 0 and creates false outlines at the screen border).
54364
+ float getMask(int x, int y) {
54368
54365
  ivec2 pixelCoord = ivec2(vUv * screenSize.xy) + ivec2(x, y);
54369
- float fragCoordZ = texelFetch(depthBuffer, pixelCoord, 0).x;
54370
- float viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);
54371
- return viewZToOrthographicDepth(viewZ, cameraNear, cameraFar);
54372
- }
54373
-
54374
- float saturate(float num) {
54375
- return clamp(num, 0.0, 1.0);
54366
+ pixelCoord = clamp(pixelCoord, ivec2(0), ivec2(screenSize.xy) - 1);
54367
+ return texelFetch(sceneBuffer, pixelCoord, 0).x;
54376
54368
  }
54377
-
54378
- void main() {
54379
- float depth = getPixelDepth(0, 0);
54380
54369
 
54381
- // Early-out: skip for background pixels (no geometry)
54382
- if (depth >= 0.99) {
54383
- fragColor = vec4(0.0, 0.0, 0.0, 0.0);
54370
+ void main() {
54371
+ // Skip non-selected pixels
54372
+ if (getMask(0, 0) < 0.5) {
54373
+ fragColor = vec4(0.0);
54384
54374
  return;
54385
54375
  }
54386
54376
 
54387
- // Cross edge detection: 4 neighbors at distance 1.
54388
- // step() converts depth diff to binary (edge or not).
54377
+ // Silhouette edge detection: outline where selected borders non-selected.
54389
54378
  // Thickness is controlled by outlineScale (render target resolution).
54390
54379
  float outline = 0.0;
54391
- outline += step(0.001, abs(depth - getPixelDepth( 0, -1)));
54392
- outline += step(0.001, abs(depth - getPixelDepth( 0, 1)));
54393
- outline += step(0.001, abs(depth - getPixelDepth(-1, 0)));
54394
- outline += step(0.001, abs(depth - getPixelDepth( 1, 0)));
54395
- outline = saturate(outline * 0.25 * intensity);
54380
+ outline += step(0.5, 1.0 - getMask( 0, -1));
54381
+ outline += step(0.5, 1.0 - getMask( 0, 1));
54382
+ outline += step(0.5, 1.0 - getMask(-1, 0));
54383
+ outline += step(0.5, 1.0 - getMask( 1, 0));
54384
+ outline = clamp(outline * 0.25 * intensity, 0.0, 1.0);
54396
54385
 
54397
- // Output outline intensity to R channel only (RedFormat texture)
54398
- // Merge pass will use this to blend outline color with scene
54399
54386
  fragColor = vec4(outline, 0.0, 0.0, 0.0);
54400
54387
  }
54401
54388
  `
@@ -55540,7 +55527,7 @@ void main() {
55540
55527
  opacityAlways: 0.1
55541
55528
  }
55542
55529
  },
55543
- background: { color: new Color(12698310) },
55530
+ background: { color: new Color(16777215) },
55544
55531
  skybox: {
55545
55532
  enable: true,
55546
55533
  skyColor: new Color(16777215),
@@ -55583,7 +55570,7 @@ void main() {
55583
55570
  strokeColor: new Color(16185078)
55584
55571
  },
55585
55572
  outline: {
55586
- intensity: 2,
55573
+ intensity: 3,
55587
55574
  color: new Color(65535),
55588
55575
  scale: 0.75
55589
55576
  }
@@ -56485,6 +56472,8 @@ void main() {
56485
56472
  this._camera,
56486
56473
  this._materials.system.mask
56487
56474
  );
56475
+ this._selectionRenderPass.clearColor = new Color(0);
56476
+ this._selectionRenderPass.clearAlpha = 0;
56488
56477
  this._composer.addPass(this._selectionRenderPass);
56489
56478
  this._outlinePass = new OutlinePass(
56490
56479
  this._camera,
@@ -56582,7 +56571,10 @@ void main() {
56582
56571
  delta,
56583
56572
  false
56584
56573
  );
56574
+ const bg = this._scene.threeScene.background;
56575
+ this._scene.threeScene.background = null;
56585
56576
  this._composer.render(delta);
56577
+ this._scene.threeScene.background = bg;
56586
56578
  }
56587
56579
  /**
56588
56580
  * Cleans up all resources used by the composer
@@ -60217,7 +60209,6 @@ Averrage Date/Second ${avgDataRatePS} kb
60217
60209
  */
60218
60210
  async _onOpen(_) {
60219
60211
  var _a3;
60220
- console.log("WebSocket connection opened to ", this.url);
60221
60212
  clearTimeout(this._connectionTimeout);
60222
60213
  this.updateState({ status: "validating" });
60223
60214
  const issues = await this._validateConnection();