vim-web 0.6.0-dev.7 → 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.
- package/dist/vim-web.iife.js +28 -35
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +28 -35
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
package/dist/vim-web.iife.js
CHANGED
|
@@ -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
|
-
//
|
|
54063
|
-
|
|
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
|
-
|
|
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
|
-
//
|
|
54367
|
-
|
|
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
|
-
|
|
54370
|
-
|
|
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
|
-
|
|
54382
|
-
|
|
54383
|
-
|
|
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
|
-
//
|
|
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.
|
|
54392
|
-
outline += step(0.
|
|
54393
|
-
outline += step(0.
|
|
54394
|
-
outline += step(0.
|
|
54395
|
-
outline =
|
|
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(
|
|
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:
|
|
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
|
|
@@ -57622,10 +57614,10 @@ void main() {
|
|
|
57622
57614
|
this._camera,
|
|
57623
57615
|
this.settings
|
|
57624
57616
|
);
|
|
57617
|
+
this.selection = createSelection$1();
|
|
57625
57618
|
this._inputs = createInputHandler(this);
|
|
57626
57619
|
this._gizmos = new Gizmos(this._renderer, this._viewport, this, this._camera);
|
|
57627
57620
|
this.materials.applySettings(this.settings.materials);
|
|
57628
|
-
this.selection = createSelection$1();
|
|
57629
57621
|
const size = this._renderer.three.getSize(new Vector2());
|
|
57630
57622
|
const gpuPicker = new GpuPicker(
|
|
57631
57623
|
this._renderer.three,
|
|
@@ -60222,6 +60214,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60222
60214
|
const issues = await this._validateConnection();
|
|
60223
60215
|
if (issues !== void 0) {
|
|
60224
60216
|
this._disconnect(issues);
|
|
60217
|
+
this._connectPromise.resolve(false);
|
|
60225
60218
|
return;
|
|
60226
60219
|
}
|
|
60227
60220
|
this._logger.log("Connected to: ", (_a3 = this._socket) == null ? void 0 : _a3.url);
|