@vived/component-pneumatic-panel 1.2.0 → 2.0.0
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/README.md +60 -21
- package/dist/Domain/Adapters/pneumaticPanelPMAdapter.d.ts.map +1 -1
- package/dist/Domain/Controllers/applyPanelState.d.ts.map +1 -1
- package/dist/Domain/Controllers/getPanelState.d.ts.map +1 -1
- package/dist/Domain/Controllers/panelStateDefaults.d.ts +0 -1
- package/dist/Domain/Controllers/panelStateDefaults.d.ts.map +1 -1
- package/dist/Domain/Entities/PneumaticPanelEntity.d.ts +0 -4
- package/dist/Domain/Entities/PneumaticPanelEntity.d.ts.map +1 -1
- package/dist/Domain/Mocks/MockPneumaticPanelSelectUC.d.ts +0 -4
- package/dist/Domain/Mocks/MockPneumaticPanelSelectUC.d.ts.map +1 -1
- package/dist/Domain/PMs/PneumaticPanelPM.d.ts +0 -3
- package/dist/Domain/PMs/PneumaticPanelPM.d.ts.map +1 -1
- package/dist/Domain/UCs/PneumaticPanelSelectUC.d.ts +0 -14
- package/dist/Domain/UCs/PneumaticPanelSelectUC.d.ts.map +1 -1
- package/dist/Frameworks/Babylon/PneumaticPanelBabylonView.d.ts +9 -12
- package/dist/Frameworks/Babylon/PneumaticPanelBabylonView.d.ts.map +1 -1
- package/dist/Frameworks/Babylon/PneumaticPanelExhaustView.d.ts +2 -2
- package/dist/Frameworks/Babylon/PneumaticPanelExhaustView.d.ts.map +1 -1
- package/dist/Frameworks/Babylon/PneumaticPanelGaugeView.d.ts +2 -2
- package/dist/Frameworks/Babylon/PneumaticPanelGaugeView.d.ts.map +1 -1
- package/dist/Frameworks/Babylon/PneumaticPanelHitboxView.d.ts +5 -7
- package/dist/Frameworks/Babylon/PneumaticPanelHitboxView.d.ts.map +1 -1
- package/dist/Frameworks/Babylon/PneumaticPanelLockView.d.ts +2 -2
- package/dist/Frameworks/Babylon/PneumaticPanelLockView.d.ts.map +1 -1
- package/dist/PneumaticPanelFacade.d.ts +1 -13
- package/dist/PneumaticPanelFacade.d.ts.map +1 -1
- package/dist/index.d.ts +1 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5169 -51
- package/package.json +1 -1
- package/dist/Domain/Controllers/clearAllHighlights.d.ts +0 -9
- package/dist/Domain/Controllers/clearAllHighlights.d.ts.map +0 -1
- package/dist/Domain/Controllers/onPanelHoverEnter.d.ts +0 -7
- package/dist/Domain/Controllers/onPanelHoverEnter.d.ts.map +0 -1
- package/dist/Domain/Controllers/onPanelHoverExit.d.ts +0 -7
- package/dist/Domain/Controllers/onPanelHoverExit.d.ts.map +0 -1
- package/dist/Domain/Controllers/panelHitboxHoverEnter.d.ts +0 -7
- package/dist/Domain/Controllers/panelHitboxHoverEnter.d.ts.map +0 -1
- package/dist/Domain/Controllers/panelHitboxHoverExit.d.ts +0 -7
- package/dist/Domain/Controllers/panelHitboxHoverExit.d.ts.map +0 -1
- package/dist/Domain/Controllers/setHighlightedObject.d.ts +0 -11
- package/dist/Domain/Controllers/setHighlightedObject.d.ts.map +0 -1
- package/dist/Frameworks/Babylon/OutlinePulseController.d.ts +0 -18
- package/dist/Frameworks/Babylon/OutlinePulseController.d.ts.map +0 -1
- package/dist/Frameworks/Babylon/OverlayPulseController.d.ts +0 -17
- package/dist/Frameworks/Babylon/OverlayPulseController.d.ts.map +0 -1
- package/dist/Frameworks/Babylon/PanelOutlineController.d.ts +0 -32
- package/dist/Frameworks/Babylon/PanelOutlineController.d.ts.map +0 -1
- package/dist/Frameworks/Babylon/ScreenSpaceOutlinePulseController.d.ts +0 -17
- package/dist/Frameworks/Babylon/ScreenSpaceOutlinePulseController.d.ts.map +0 -1
- package/dist/clipPlaneFragment-BRmzi2tV.js +0 -55
- package/dist/clipPlaneFragment-CDdVuU0n.js +0 -55
- package/dist/clipPlaneVertex-CIEg9nQi.js +0 -358
- package/dist/clipPlaneVertex-CIarPzTc.js +0 -391
- package/dist/dumpTools-BUC-AUZt.js +0 -110
- package/dist/glowBlurPostProcess.fragment-DDhSDO38.js +0 -13
- package/dist/glowBlurPostProcess.fragment-fpk0xJVe.js +0 -13
- package/dist/glowMapGeneration.fragment-BBSNxu8K.js +0 -193
- package/dist/glowMapGeneration.fragment-Cl-xwsZp.js +0 -161
- package/dist/glowMapGeneration.vertex-CzQHgJdT.js +0 -85
- package/dist/glowMapGeneration.vertex-DErxE57o.js +0 -85
- package/dist/glowMapMerge.vertex-BQosy0g5.js +0 -14
- package/dist/glowMapMerge.vertex-tVYqLRGm.js +0 -13
- package/dist/index-CmNnQLDH.js +0 -36863
- package/dist/pass.fragment-D3pYn4R1.js +0 -10
- package/dist/selection.fragment-CGZK1kVt.js +0 -45
- package/dist/selection.fragment-DjWRsu7R.js +0 -45
- package/dist/selection.vertex-DY_1B2lX.js +0 -84
- package/dist/selection.vertex-PhS5tOTA.js +0 -83
- package/dist/selectionOutline.fragment-Bp__J_pC.js +0 -53
- package/dist/selectionOutline.fragment-DmyQJACa.js +0 -54
- package/dist/thinEngine-dZnz-Owz.js +0 -4
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { S as r } from "./index-CmNnQLDH.js";
|
|
2
|
-
const e = "passPixelShader", a = `varying vec2 vUV;uniform sampler2D textureSampler;
|
|
3
|
-
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
4
|
-
void main(void)
|
|
5
|
-
{gl_FragColor=texture2D(textureSampler,vUV);}`;
|
|
6
|
-
r.ShadersStore[e] || (r.ShadersStore[e] = a);
|
|
7
|
-
const t = { name: e, shader: a };
|
|
8
|
-
export {
|
|
9
|
-
t as passPixelShader
|
|
10
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { S as e } from "./index-CmNnQLDH.js";
|
|
2
|
-
import { a as d, c as r } from "./clipPlaneFragment-BRmzi2tV.js";
|
|
3
|
-
const a = "selectionPixelShader", n = `#ifdef INSTANCES
|
|
4
|
-
flat varying float vSelectionId;
|
|
5
|
-
#else
|
|
6
|
-
uniform float selectionId;
|
|
7
|
-
#endif
|
|
8
|
-
#ifdef STORE_CAMERASPACE_Z
|
|
9
|
-
varying float vViewPosZ;
|
|
10
|
-
#else
|
|
11
|
-
varying float vDepthMetric;
|
|
12
|
-
#endif
|
|
13
|
-
#ifdef ALPHATEST
|
|
14
|
-
varying vec2 vUV;uniform sampler2D diffuseSampler;
|
|
15
|
-
#endif
|
|
16
|
-
#include<clipPlaneFragmentDeclaration>
|
|
17
|
-
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
18
|
-
void main(void) {
|
|
19
|
-
#define CUSTOM_FRAGMENT_MAIN_BEGIN
|
|
20
|
-
#include<clipPlaneFragment>
|
|
21
|
-
#ifdef ALPHATEST
|
|
22
|
-
if (texture2D(diffuseSampler,vUV).a<0.4)
|
|
23
|
-
discard;
|
|
24
|
-
#endif
|
|
25
|
-
#ifdef INSTANCES
|
|
26
|
-
float id=vSelectionId;
|
|
27
|
-
#else
|
|
28
|
-
float id=selectionId;
|
|
29
|
-
#endif
|
|
30
|
-
#ifdef STORE_CAMERASPACE_Z
|
|
31
|
-
gl_FragColor=vec4(id,vViewPosZ,0.0,1.0);
|
|
32
|
-
#else
|
|
33
|
-
gl_FragColor=vec4(id,vDepthMetric,0.0,1.0);
|
|
34
|
-
#endif
|
|
35
|
-
#define CUSTOM_FRAGMENT_MAIN_END
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
38
|
-
e.ShadersStore[a] || (e.ShadersStore[a] = n);
|
|
39
|
-
const f = [d, r];
|
|
40
|
-
for (const i of f)
|
|
41
|
-
e.IncludesShadersStore[i.name] || (e.IncludesShadersStore[i.name] = i.shader);
|
|
42
|
-
const t = { name: a, shader: n };
|
|
43
|
-
export {
|
|
44
|
-
t as selectionPixelShader
|
|
45
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { S as e } from "./index-CmNnQLDH.js";
|
|
2
|
-
import { c as a, a as f } from "./clipPlaneFragment-CDdVuU0n.js";
|
|
3
|
-
const i = "selectionPixelShader", r = `#ifdef INSTANCES
|
|
4
|
-
flat varying vSelectionId: f32;
|
|
5
|
-
#else
|
|
6
|
-
uniform selectionId: f32;
|
|
7
|
-
#endif
|
|
8
|
-
#ifdef STORE_CAMERASPACE_Z
|
|
9
|
-
varying vViewPosZ: f32;
|
|
10
|
-
#else
|
|
11
|
-
varying vDepthMetric: f32;
|
|
12
|
-
#endif
|
|
13
|
-
#ifdef ALPHATEST
|
|
14
|
-
varying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
|
|
15
|
-
#endif
|
|
16
|
-
#include<clipPlaneFragmentDeclaration>
|
|
17
|
-
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
18
|
-
@fragment
|
|
19
|
-
fn main(input: FragmentInputs)->FragmentOutputs {
|
|
20
|
-
#define CUSTOM_FRAGMENT_MAIN_BEGIN
|
|
21
|
-
#include<clipPlaneFragment>
|
|
22
|
-
#ifdef ALPHATEST
|
|
23
|
-
if (textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUV).a<0.4) {discard;}
|
|
24
|
-
#endif
|
|
25
|
-
#ifdef INSTANCES
|
|
26
|
-
var id: f32=fragmentInputs.vSelectionId;
|
|
27
|
-
#else
|
|
28
|
-
var id: f32=uniforms.selectionId;
|
|
29
|
-
#endif
|
|
30
|
-
#ifdef STORE_CAMERASPACE_Z
|
|
31
|
-
fragmentOutputs.color=vec4(id,fragmentInputs.vViewPosZ,0.0,1.0);
|
|
32
|
-
#else
|
|
33
|
-
fragmentOutputs.color=vec4(id,fragmentInputs.vDepthMetric,0.0,1.0);
|
|
34
|
-
#endif
|
|
35
|
-
#define CUSTOM_FRAGMENT_MAIN_END
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
38
|
-
e.ShadersStoreWGSL[i] || (e.ShadersStoreWGSL[i] = r);
|
|
39
|
-
const t = [a, f];
|
|
40
|
-
for (const n of t)
|
|
41
|
-
e.IncludesShadersStoreWGSL[n.name] || (e.IncludesShadersStoreWGSL[n.name] = n.shader);
|
|
42
|
-
const s = { name: i, shader: r };
|
|
43
|
-
export {
|
|
44
|
-
s as selectionPixelShaderWGSL
|
|
45
|
-
};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { S as e } from "./index-CmNnQLDH.js";
|
|
2
|
-
import { c as r, b as a, h as s, m as o, e as f, i as d, j as u, k as c, g as l, d as v, a as S, f as p } from "./clipPlaneVertex-CIarPzTc.js";
|
|
3
|
-
const i = "selectionVertexShader", n = `attribute position: vec3f;
|
|
4
|
-
#ifdef INSTANCES
|
|
5
|
-
attribute instanceSelectionId: f32;
|
|
6
|
-
#endif
|
|
7
|
-
#include<bonesDeclaration>
|
|
8
|
-
#include<bakedVertexAnimationDeclaration>
|
|
9
|
-
#include<morphTargetsVertexGlobalDeclaration>
|
|
10
|
-
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
|
|
11
|
-
#include<clipPlaneVertexDeclaration>
|
|
12
|
-
#include<instancesDeclaration>
|
|
13
|
-
uniform viewProjection: mat4x4f;
|
|
14
|
-
#ifdef STORE_CAMERASPACE_Z
|
|
15
|
-
uniform view: mat4x4f;
|
|
16
|
-
#else
|
|
17
|
-
uniform depthValues: vec2f;
|
|
18
|
-
#endif
|
|
19
|
-
#ifdef INSTANCES
|
|
20
|
-
flat varying vSelectionId: f32;
|
|
21
|
-
#endif
|
|
22
|
-
#ifdef STORE_CAMERASPACE_Z
|
|
23
|
-
varying vViewPosZ: f32;
|
|
24
|
-
#else
|
|
25
|
-
varying vDepthMetric: f32;
|
|
26
|
-
#endif
|
|
27
|
-
#ifdef ALPHATEST
|
|
28
|
-
varying vUV: vec2f;uniform diffuseMatrix: mat4x4f;
|
|
29
|
-
#ifdef UV1
|
|
30
|
-
attribute uv: vec2f;
|
|
31
|
-
#endif
|
|
32
|
-
#ifdef UV2
|
|
33
|
-
attribute uv2: vec2f;
|
|
34
|
-
#endif
|
|
35
|
-
#endif
|
|
36
|
-
#define CUSTOM_VERTEX_DEFINITIONS
|
|
37
|
-
@vertex
|
|
38
|
-
fn main(input: VertexInputs)->FragmentInputs {
|
|
39
|
-
#define CUSTOM_VERTEX_MAIN_BEGIN
|
|
40
|
-
var positionUpdated: vec3f=vertexInputs.position;
|
|
41
|
-
#ifdef UV1
|
|
42
|
-
var uvUpdated: vec2f=vertexInputs.uv;
|
|
43
|
-
#endif
|
|
44
|
-
#ifdef UV2
|
|
45
|
-
var uv2Updated: vec2f=vertexInputs.uv2;
|
|
46
|
-
#endif
|
|
47
|
-
#include<morphTargetsVertexGlobal>
|
|
48
|
-
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
|
|
49
|
-
#include<instancesVertex>
|
|
50
|
-
#include<bonesVertex>
|
|
51
|
-
#include<bakedVertexAnimation>
|
|
52
|
-
var worldPos: vec4f=finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;
|
|
53
|
-
#ifdef ALPHATEST
|
|
54
|
-
#ifdef UV1
|
|
55
|
-
vertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(uvUpdated,1.0,0.0)).xy;
|
|
56
|
-
#endif
|
|
57
|
-
#ifdef UV2
|
|
58
|
-
vertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(uv2Updated,1.0,0.0)).xy;
|
|
59
|
-
#endif
|
|
60
|
-
#endif
|
|
61
|
-
#ifdef STORE_CAMERASPACE_Z
|
|
62
|
-
vertexOutputs.vViewPosZ=(uniforms.view*worldPos).z;
|
|
63
|
-
#else
|
|
64
|
-
#ifdef USE_REVERSE_DEPTHBUFFER
|
|
65
|
-
vertexOutputs.vDepthMetric=((-vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));
|
|
66
|
-
#else
|
|
67
|
-
vertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));
|
|
68
|
-
#endif
|
|
69
|
-
#endif
|
|
70
|
-
#ifdef INSTANCES
|
|
71
|
-
vertexOutputs.vSelectionId=vertexInputs.instanceSelectionId;
|
|
72
|
-
#endif
|
|
73
|
-
#include<clipPlaneVertex>
|
|
74
|
-
#define CUSTOM_VERTEX_MAIN_END
|
|
75
|
-
}
|
|
76
|
-
`;
|
|
77
|
-
e.ShadersStoreWGSL[i] || (e.ShadersStoreWGSL[i] = n);
|
|
78
|
-
const x = [r, a, s, o, f, d, u, c, l, v, S, p];
|
|
79
|
-
for (const t of x)
|
|
80
|
-
e.IncludesShadersStoreWGSL[t.name] || (e.IncludesShadersStoreWGSL[t.name] = t.shader);
|
|
81
|
-
const E = { name: i, shader: n };
|
|
82
|
-
export {
|
|
83
|
-
E as selectionVertexShaderWGSL
|
|
84
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { S as e } from "./index-CmNnQLDH.js";
|
|
2
|
-
import { c as n, a as r, k as o, h as d, f as s, i as l, j as f, m as c, g as u, d as v, b as V, e as S } from "./clipPlaneVertex-CIEg9nQi.js";
|
|
3
|
-
const t = "selectionVertexShader", a = `attribute vec3 position;
|
|
4
|
-
#ifdef INSTANCES
|
|
5
|
-
attribute float instanceSelectionId;
|
|
6
|
-
#endif
|
|
7
|
-
#include<bonesDeclaration>
|
|
8
|
-
#include<bakedVertexAnimationDeclaration>
|
|
9
|
-
#include<morphTargetsVertexGlobalDeclaration>
|
|
10
|
-
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
|
|
11
|
-
#include<clipPlaneVertexDeclaration>
|
|
12
|
-
#include<instancesDeclaration>
|
|
13
|
-
uniform mat4 viewProjection;
|
|
14
|
-
#ifdef STORE_CAMERASPACE_Z
|
|
15
|
-
uniform mat4 view;
|
|
16
|
-
#else
|
|
17
|
-
uniform vec2 depthValues;
|
|
18
|
-
#endif
|
|
19
|
-
#ifdef INSTANCES
|
|
20
|
-
flat varying float vSelectionId;
|
|
21
|
-
#endif
|
|
22
|
-
#ifdef STORE_CAMERASPACE_Z
|
|
23
|
-
varying float vViewPosZ;
|
|
24
|
-
#else
|
|
25
|
-
varying float vDepthMetric;
|
|
26
|
-
#endif
|
|
27
|
-
#ifdef ALPHATEST
|
|
28
|
-
varying vec2 vUV;uniform mat4 diffuseMatrix;
|
|
29
|
-
#ifdef UV1
|
|
30
|
-
attribute vec2 uv;
|
|
31
|
-
#endif
|
|
32
|
-
#ifdef UV2
|
|
33
|
-
attribute vec2 uv2;
|
|
34
|
-
#endif
|
|
35
|
-
#endif
|
|
36
|
-
#define CUSTOM_VERTEX_DEFINITIONS
|
|
37
|
-
void main(void) {
|
|
38
|
-
#define CUSTOM_VERTEX_MAIN_BEGIN
|
|
39
|
-
vec3 positionUpdated=position;
|
|
40
|
-
#ifdef UV1
|
|
41
|
-
vec2 uvUpdated=uv;
|
|
42
|
-
#endif
|
|
43
|
-
#ifdef UV2
|
|
44
|
-
vec2 uv2Updated=uv2;
|
|
45
|
-
#endif
|
|
46
|
-
#include<morphTargetsVertexGlobal>
|
|
47
|
-
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
|
|
48
|
-
#include<instancesVertex>
|
|
49
|
-
#include<bonesVertex>
|
|
50
|
-
#include<bakedVertexAnimation>
|
|
51
|
-
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);gl_Position=viewProjection*worldPos;
|
|
52
|
-
#ifdef ALPHATEST
|
|
53
|
-
#ifdef UV1
|
|
54
|
-
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
|
|
55
|
-
#endif
|
|
56
|
-
#ifdef UV2
|
|
57
|
-
vUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));
|
|
58
|
-
#endif
|
|
59
|
-
#endif
|
|
60
|
-
#ifdef STORE_CAMERASPACE_Z
|
|
61
|
-
vViewPosZ=(view*worldPos).z;
|
|
62
|
-
#else
|
|
63
|
-
#ifdef USE_REVERSE_DEPTHBUFFER
|
|
64
|
-
vDepthMetric=((-gl_Position.z+depthValues.x)/(depthValues.y));
|
|
65
|
-
#else
|
|
66
|
-
vDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));
|
|
67
|
-
#endif
|
|
68
|
-
#endif
|
|
69
|
-
#ifdef INSTANCES
|
|
70
|
-
vSelectionId=instanceSelectionId;
|
|
71
|
-
#endif
|
|
72
|
-
#include<clipPlaneVertex>
|
|
73
|
-
#define CUSTOM_VERTEX_MAIN_END
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
e.ShadersStore[t] || (e.ShadersStore[t] = a);
|
|
77
|
-
const p = [n, r, o, d, s, l, f, c, u, v, V, S];
|
|
78
|
-
for (const i of p)
|
|
79
|
-
e.IncludesShadersStore[i.name] || (e.IncludesShadersStore[i.name] = i.shader);
|
|
80
|
-
const E = { name: t, shader: a };
|
|
81
|
-
export {
|
|
82
|
-
E as selectionVertexShader
|
|
83
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { S as t } from "./index-CmNnQLDH.js";
|
|
2
|
-
const e = "selectionOutlinePixelShader", o = `uniform sampler2D maskSampler;uniform sampler2D depthSampler;varying vec2 vUV;uniform vec2 screenSize;uniform vec3 outlineColor;uniform float outlineThickness;uniform float occlusionStrength;uniform float occlusionThreshold;
|
|
3
|
-
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
4
|
-
void main(void) {
|
|
5
|
-
#define CUSTOM_FRAGMENT_MAIN_BEGIN
|
|
6
|
-
vec2 texelSize=1.0/screenSize;vec2 sampleOffset=texelSize*outlineThickness;
|
|
7
|
-
#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
8
|
-
vec2 maskTopCenter=texture2D(maskSampler,vUV+vec2(0.0,sampleOffset.y)).rg;vec2 maskTopRight=texture2D(maskSampler,vUV+sampleOffset).rg;vec2 maskMiddleCenter=texture2D(maskSampler,vUV).rg;vec2 maskMiddleRight=texture2D(maskSampler,vUV+vec2(sampleOffset.x,0.0)).rg;
|
|
9
|
-
#endif
|
|
10
|
-
#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
11
|
-
vec2 maskTopLeft=texture2D(maskSampler,vUV+vec2(-sampleOffset.x,sampleOffset.y)).rg;vec2 maskMiddleLeft=texture2D(maskSampler,vUV+vec2(-sampleOffset.x,0.0)).rg;vec2 maskBottomRight=texture2D(maskSampler,vUV+vec2(sampleOffset.x,-sampleOffset.y)).rg;vec2 maskBottomCenter=texture2D(maskSampler,vUV+vec2(0.0,-sampleOffset.y)).rg;vec2 maskBottomLeft=texture2D(maskSampler,vUV+vec2(-sampleOffset.x,-sampleOffset.y)).rg;
|
|
12
|
-
#endif
|
|
13
|
-
#ifdef OUTLINELAYER_SAMPLING_TRIDIRECTIONAL
|
|
14
|
-
vec3 gradient=vec3(
|
|
15
|
-
maskMiddleCenter.r-maskMiddleRight.r,
|
|
16
|
-
maskMiddleCenter.r-maskTopCenter.r,
|
|
17
|
-
maskMiddleCenter.r-maskTopRight.r
|
|
18
|
-
);float edgeStrength=length(gradient);
|
|
19
|
-
#elif defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
20
|
-
float gradientX=
|
|
21
|
-
(maskTopLeft.r+2.0*maskMiddleLeft.r+maskBottomLeft.r) -
|
|
22
|
-
(maskTopRight.r+2.0*maskMiddleRight.r+maskBottomRight.r);float gradientY=
|
|
23
|
-
(maskBottomLeft.r+2.0*maskBottomCenter.r+maskBottomRight.r) -
|
|
24
|
-
(maskTopLeft.r+2.0*maskTopCenter.r+maskTopRight.r);float edgeStrength=length(vec2(gradientX,gradientY));
|
|
25
|
-
#endif
|
|
26
|
-
float outlineMask=step(0.5,edgeStrength);
|
|
27
|
-
#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
28
|
-
float depthTopCenter=texture2D(depthSampler,vUV+vec2(0.0,sampleOffset.y)).r;float depthTopRight=texture2D(depthSampler,vUV+sampleOffset).r;float depthMiddleCenter=texture2D(depthSampler,vUV).r;float depthMiddleRight=texture2D(depthSampler,vUV+vec2(sampleOffset.x,0.0)).r;
|
|
29
|
-
#endif
|
|
30
|
-
#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
31
|
-
float depthTopLeft=texture2D(depthSampler,vUV+vec2(-sampleOffset.x,sampleOffset.y)).r;float depthMiddleLeft=texture2D(depthSampler,vUV+vec2(-sampleOffset.x,0.0)).r;float depthBottomRight=texture2D(depthSampler,vUV+vec2(sampleOffset.x,-sampleOffset.y)).r;float depthBottomCenter=texture2D(depthSampler,vUV+vec2(0.0,-sampleOffset.y)).r;float depthBottomLeft=texture2D(depthSampler,vUV+vec2(-sampleOffset.x,-sampleOffset.y)).r;
|
|
32
|
-
#endif
|
|
33
|
-
#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
34
|
-
float occlusionTopCenter=step(occlusionThreshold,abs(maskTopCenter.g-depthTopCenter));float occlusionTopRight=step(occlusionThreshold,abs(maskTopRight.g-depthTopRight));float occlusionMiddleCenter=step(occlusionThreshold,abs(maskMiddleCenter.g-depthMiddleCenter));float occlusionMiddleRight=step(occlusionThreshold,abs(maskMiddleRight.g-depthMiddleRight));
|
|
35
|
-
#endif
|
|
36
|
-
#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
37
|
-
float occlusionTopLeft=step(occlusionThreshold,abs(maskTopLeft.g-depthTopLeft));float occlusionMiddleLeft=step(occlusionThreshold,abs(maskMiddleLeft.g-depthMiddleLeft));float occlusionBottomRight=step(occlusionThreshold,abs(maskBottomRight.g-depthBottomRight));float occlusionBottomCenter=step(occlusionThreshold,abs(maskBottomCenter.g-depthBottomCenter));float occlusionBottomLeft=step(occlusionThreshold,abs(maskBottomLeft.g-depthBottomLeft));
|
|
38
|
-
#endif
|
|
39
|
-
float occlusionFactor=occlusionMiddleCenter;
|
|
40
|
-
#ifdef OUTLINELAYER_SAMPLING_TRIDIRECTIONAL
|
|
41
|
-
occlusionFactor=min(occlusionFactor,occlusionTopCenter);occlusionFactor=min(occlusionFactor,occlusionTopRight);occlusionFactor=min(occlusionFactor,occlusionMiddleRight);
|
|
42
|
-
#elif defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
43
|
-
occlusionFactor=min(occlusionFactor,occlusionTopCenter);occlusionFactor=min(occlusionFactor,occlusionTopRight);occlusionFactor=min(occlusionFactor,occlusionTopLeft);occlusionFactor=min(occlusionFactor,occlusionMiddleRight);occlusionFactor=min(occlusionFactor,occlusionMiddleLeft);occlusionFactor=min(occlusionFactor,occlusionBottomRight);occlusionFactor=min(occlusionFactor,occlusionBottomCenter);occlusionFactor=min(occlusionFactor,occlusionBottomLeft);
|
|
44
|
-
#endif
|
|
45
|
-
float finalOutlineMask=outlineMask*(1.0-occlusionStrength*occlusionFactor);gl_FragColor=vec4(outlineColor,finalOutlineMask);
|
|
46
|
-
#define CUSTOM_FRAGMENT_MAIN_END
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
|
-
t.ShadersStore[e] || (t.ShadersStore[e] = o);
|
|
50
|
-
const i = { name: e, shader: o };
|
|
51
|
-
export {
|
|
52
|
-
i as selectionOutlinePixelShader
|
|
53
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { S as t } from "./index-CmNnQLDH.js";
|
|
2
|
-
const e = "selectionOutlinePixelShader", l = `var maskSamplerSampler: sampler;var maskSampler: texture_2d<f32>;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;varying vUV: vec2f;uniform screenSize: vec2f;uniform outlineColor: vec3f;uniform outlineThickness: f32;uniform occlusionStrength: f32;uniform occlusionThreshold: f32;
|
|
3
|
-
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
4
|
-
@fragment
|
|
5
|
-
fn main(input: FragmentInputs)->FragmentOutputs {
|
|
6
|
-
#define CUSTOM_FRAGMENT_MAIN_BEGIN
|
|
7
|
-
let texelSize: vec2f=1.0/uniforms.screenSize;let sampleOffset: vec2f=texelSize*uniforms.outlineThickness;
|
|
8
|
-
#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
9
|
-
let maskTopCenter: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(0.0,sampleOffset.y),0.0).rg;let maskTopRight: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+sampleOffset,0.0).rg;let maskMiddleCenter: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV,0.0).rg;let maskMiddleRight: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,0.0),0.0).rg;
|
|
10
|
-
#endif
|
|
11
|
-
#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
12
|
-
let maskTopLeft: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,sampleOffset.y),0.0).rg;let maskMiddleLeft: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,0.0),0.0).rg;let maskBottomRight: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,-sampleOffset.y),0.0).rg;let maskBottomCenter: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(0.0,-sampleOffset.y),0.0).rg;let maskBottomLeft: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,-sampleOffset.y),0.0).rg;
|
|
13
|
-
#endif
|
|
14
|
-
#ifdef OUTLINELAYER_SAMPLING_TRIDIRECTIONAL
|
|
15
|
-
let gradient: vec3f=vec3f(
|
|
16
|
-
maskMiddleCenter.r-maskMiddleRight.r,
|
|
17
|
-
maskMiddleCenter.r-maskTopCenter.r,
|
|
18
|
-
maskMiddleCenter.r-maskTopRight.r
|
|
19
|
-
);let edgeStrength: f32=length(gradient);
|
|
20
|
-
#elif defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
21
|
-
let gradientX: f32 =
|
|
22
|
-
(maskTopLeft.r+2.0*maskMiddleLeft.r+maskBottomLeft.r) -
|
|
23
|
-
(maskTopRight.r+2.0*maskMiddleRight.r+maskBottomRight.r);let gradientY: f32 =
|
|
24
|
-
(maskBottomLeft.r+2.0*maskBottomCenter.r+maskBottomRight.r) -
|
|
25
|
-
(maskTopLeft.r+2.0*maskTopCenter.r+maskTopRight.r);let edgeStrength: f32=length(vec2f(gradientX,gradientY));
|
|
26
|
-
#endif
|
|
27
|
-
let outlineMask: f32=step(0.5,edgeStrength);
|
|
28
|
-
#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
29
|
-
let depthTopCenter: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(0.0,sampleOffset.y),0.0).r;let depthTopRight: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+sampleOffset,0.0).r;let depthMiddleCenter: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV,0.0).r;let depthMiddleRight: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,0.0),0.0).r;
|
|
30
|
-
#endif
|
|
31
|
-
#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
32
|
-
let depthTopLeft: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,sampleOffset.y),0.0).r;let depthMiddleLeft: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,0.0),0.0).r;let depthBottomRight: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,-sampleOffset.y),0.0).r;let depthBottomCenter: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(0.0,-sampleOffset.y),0.0).r;let depthBottomLeft: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,-sampleOffset.y),0.0).r;
|
|
33
|
-
#endif
|
|
34
|
-
#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
35
|
-
let occlusionTopCenter: f32=step(uniforms.occlusionThreshold,abs(maskTopCenter.g-depthTopCenter));let occlusionTopRight: f32=step(uniforms.occlusionThreshold,abs(maskTopRight.g-depthTopRight));let occlusionMiddleCenter: f32=step(uniforms.occlusionThreshold,abs(maskMiddleCenter.g-depthMiddleCenter));let occlusionMiddleRight: f32=step(uniforms.occlusionThreshold,abs(maskMiddleRight.g-depthMiddleRight));
|
|
36
|
-
#endif
|
|
37
|
-
#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
38
|
-
let occlusionTopLeft: f32=step(uniforms.occlusionThreshold,abs(maskTopLeft.g-depthTopLeft));let occlusionMiddleLeft: f32=step(uniforms.occlusionThreshold,abs(maskMiddleLeft.g-depthMiddleLeft));let occlusionBottomRight: f32=step(uniforms.occlusionThreshold,abs(maskBottomRight.g-depthBottomRight));let occlusionBottomCenter: f32=step(uniforms.occlusionThreshold,abs(maskBottomCenter.g-depthBottomCenter));let occlusionBottomLeft: f32=step(uniforms.occlusionThreshold,abs(maskBottomLeft.g-depthBottomLeft));
|
|
39
|
-
#endif
|
|
40
|
-
var occlusionFactor: f32=occlusionMiddleCenter;
|
|
41
|
-
#ifdef OUTLINELAYER_SAMPLING_TRIDIRECTIONAL
|
|
42
|
-
occlusionFactor=min(occlusionFactor,occlusionTopCenter);occlusionFactor=min(occlusionFactor,occlusionTopRight);occlusionFactor=min(occlusionFactor,occlusionMiddleRight);
|
|
43
|
-
#elif defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)
|
|
44
|
-
occlusionFactor=min(occlusionFactor,occlusionTopCenter);occlusionFactor=min(occlusionFactor,occlusionTopRight);occlusionFactor=min(occlusionFactor,occlusionTopLeft);occlusionFactor=min(occlusionFactor,occlusionMiddleRight);occlusionFactor=min(occlusionFactor,occlusionMiddleLeft);occlusionFactor=min(occlusionFactor,occlusionBottomRight);occlusionFactor=min(occlusionFactor,occlusionBottomCenter);occlusionFactor=min(occlusionFactor,occlusionBottomLeft);
|
|
45
|
-
#endif
|
|
46
|
-
let finalOutlineMask: f32=outlineMask*(1.0-uniforms.occlusionStrength*occlusionFactor);fragmentOutputs.color=vec4f(uniforms.outlineColor,finalOutlineMask);
|
|
47
|
-
#define CUSTOM_FRAGMENT_MAIN_END
|
|
48
|
-
}
|
|
49
|
-
`;
|
|
50
|
-
t.ShadersStoreWGSL[e] || (t.ShadersStoreWGSL[e] = l);
|
|
51
|
-
const r = { name: e, shader: l };
|
|
52
|
-
export {
|
|
53
|
-
r as selectionOutlinePixelShaderWGSL
|
|
54
|
-
};
|