@onerjs/core 8.37.6 → 8.37.8

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.
Files changed (79) hide show
  1. package/Animations/animationGroup.d.ts +2 -3
  2. package/Animations/animationGroup.js +10 -15
  3. package/Animations/animationGroup.js.map +1 -1
  4. package/Bones/bone.d.ts +2 -0
  5. package/Bones/bone.js +2 -0
  6. package/Bones/bone.js.map +1 -1
  7. package/Bones/skeleton.js +7 -0
  8. package/Bones/skeleton.js.map +1 -1
  9. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +3 -1
  10. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  11. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +3 -1
  12. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
  13. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +1 -1
  14. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  15. package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js +3 -1
  16. package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js.map +1 -1
  17. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +3 -1
  18. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
  19. package/Layers/effectLayer.d.ts +4 -0
  20. package/Layers/effectLayer.js +2 -0
  21. package/Layers/effectLayer.js.map +1 -1
  22. package/Layers/highlightLayer.js +1 -0
  23. package/Layers/highlightLayer.js.map +1 -1
  24. package/Layers/index.d.ts +2 -0
  25. package/Layers/index.js +2 -0
  26. package/Layers/index.js.map +1 -1
  27. package/Layers/selectionOutlineLayer.d.ts +180 -0
  28. package/Layers/selectionOutlineLayer.js +319 -0
  29. package/Layers/selectionOutlineLayer.js.map +1 -0
  30. package/Layers/thinEffectLayer.d.ts +5 -1
  31. package/Layers/thinEffectLayer.js +21 -16
  32. package/Layers/thinEffectLayer.js.map +1 -1
  33. package/Layers/thinGlowLayer.js +1 -0
  34. package/Layers/thinGlowLayer.js.map +1 -1
  35. package/Layers/thinHighlightLayer.js +1 -0
  36. package/Layers/thinHighlightLayer.js.map +1 -1
  37. package/Layers/thinSelectionOutlineLayer.d.ts +148 -0
  38. package/Layers/thinSelectionOutlineLayer.js +579 -0
  39. package/Layers/thinSelectionOutlineLayer.js.map +1 -0
  40. package/Loading/Plugins/babylonFileLoader.js +136 -48
  41. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  42. package/Maths/math.vector.functions.d.ts +8 -0
  43. package/Maths/math.vector.functions.js +10 -0
  44. package/Maths/math.vector.functions.js.map +1 -1
  45. package/Meshes/abstractMesh.d.ts +8 -0
  46. package/Meshes/abstractMesh.js +8 -0
  47. package/Meshes/abstractMesh.js.map +1 -1
  48. package/Meshes/csg2.js +9 -1
  49. package/Meshes/csg2.js.map +1 -1
  50. package/Meshes/instancedMesh.js +2 -2
  51. package/Meshes/instancedMesh.js.map +1 -1
  52. package/Meshes/mesh.js +6 -1
  53. package/Meshes/mesh.js.map +1 -1
  54. package/Meshes/subMesh.js +1 -1
  55. package/Meshes/subMesh.js.map +1 -1
  56. package/Morph/morphTarget.js +2 -1
  57. package/Morph/morphTarget.js.map +1 -1
  58. package/Shaders/selection.fragment.d.ts +7 -0
  59. package/Shaders/selection.fragment.js +47 -0
  60. package/Shaders/selection.fragment.js.map +1 -0
  61. package/Shaders/selection.vertex.d.ts +17 -0
  62. package/Shaders/selection.vertex.js +95 -0
  63. package/Shaders/selection.vertex.js.map +1 -0
  64. package/Shaders/selectionOutline.fragment.d.ts +5 -0
  65. package/Shaders/selectionOutline.fragment.js +23 -0
  66. package/Shaders/selectionOutline.fragment.js.map +1 -0
  67. package/ShadersWGSL/selection.fragment.d.ts +7 -0
  68. package/ShadersWGSL/selection.fragment.js +47 -0
  69. package/ShadersWGSL/selection.fragment.js.map +1 -0
  70. package/ShadersWGSL/selection.vertex.d.ts +17 -0
  71. package/ShadersWGSL/selection.vertex.js +96 -0
  72. package/ShadersWGSL/selection.vertex.js.map +1 -0
  73. package/ShadersWGSL/selectionOutline.fragment.d.ts +5 -0
  74. package/ShadersWGSL/selectionOutline.fragment.js +24 -0
  75. package/ShadersWGSL/selectionOutline.fragment.js.map +1 -0
  76. package/package.json +1 -1
  77. package/scene.d.ts +2 -2
  78. package/scene.js +10 -2
  79. package/scene.js.map +1 -1
@@ -0,0 +1,47 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ import "./ShadersInclude/clipPlaneFragmentDeclaration.js";
4
+ import "./ShadersInclude/clipPlaneFragment.js";
5
+ const name = "selectionPixelShader";
6
+ const shader = `#ifdef INSTANCES
7
+ flat varying vSelectionId: f32;
8
+ #else
9
+ uniform selectionId: f32;
10
+ #endif
11
+ #ifdef STORE_CAMERASPACE_Z
12
+ varying vViewPosZ: f32;
13
+ #else
14
+ varying vDepthMetric: f32;
15
+ #endif
16
+ #ifdef ALPHATEST
17
+ varying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
18
+ #endif
19
+ #include<clipPlaneFragmentDeclaration>
20
+ #define CUSTOM_FRAGMENT_DEFINITIONS
21
+ @fragment
22
+ fn main(input: FragmentInputs)->FragmentOutputs {
23
+ #define CUSTOM_FRAGMENT_MAIN_BEGIN
24
+ #include<clipPlaneFragment>
25
+ #ifdef ALPHATEST
26
+ if (textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUV).a<0.4) {discard;}
27
+ #endif
28
+ #ifdef INSTANCES
29
+ var id: f32=fragmentInputs.vSelectionId;
30
+ #else
31
+ var id: f32=uniforms.selectionId;
32
+ #endif
33
+ #ifdef STORE_CAMERASPACE_Z
34
+ fragmentOutputs.color=vec4(id,fragmentInputs.vViewPosZ,0.0,1.0);
35
+ #else
36
+ fragmentOutputs.color=vec4(id,fragmentInputs.vDepthMetric,0.0,1.0);
37
+ #endif
38
+ #define CUSTOM_FRAGMENT_MAIN_END
39
+ }
40
+ `;
41
+ // Sideeffect
42
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
43
+ ShaderStore.ShadersStoreWGSL[name] = shader;
44
+ }
45
+ /** @internal */
46
+ export const selectionPixelShaderWGSL = { name, shader };
47
+ //# sourceMappingURL=selection.fragment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/selection.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,oCAAoC,CAAC;AAE5C,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport \"./ShadersInclude/clipPlaneFragment\";\n\nconst name = \"selectionPixelShader\";\nconst shader = `#ifdef INSTANCES\nflat varying vSelectionId: f32;\n#else\nuniform selectionId: f32;\n#endif\n#ifdef STORE_CAMERASPACE_Z\nvarying vViewPosZ: f32;\n#else\nvarying vDepthMetric: f32;\n#endif\n#ifdef ALPHATEST\nvarying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nif (textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUV).a<0.4) {discard;}\n#endif\n#ifdef INSTANCES\nvar id: f32=fragmentInputs.vSelectionId;\n#else\nvar id: f32=uniforms.selectionId;\n#endif\n#ifdef STORE_CAMERASPACE_Z\nfragmentOutputs.color=vec4(id,fragmentInputs.vViewPosZ,0.0,1.0);\n#else\nfragmentOutputs.color=vec4(id,fragmentInputs.vDepthMetric,0.0,1.0);\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const selectionPixelShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,17 @@
1
+ import "./ShadersInclude/bonesDeclaration.js";
2
+ import "./ShadersInclude/bakedVertexAnimationDeclaration.js";
3
+ import "./ShadersInclude/morphTargetsVertexGlobalDeclaration.js";
4
+ import "./ShadersInclude/morphTargetsVertexDeclaration.js";
5
+ import "./ShadersInclude/clipPlaneVertexDeclaration.js";
6
+ import "./ShadersInclude/instancesDeclaration.js";
7
+ import "./ShadersInclude/morphTargetsVertexGlobal.js";
8
+ import "./ShadersInclude/morphTargetsVertex.js";
9
+ import "./ShadersInclude/instancesVertex.js";
10
+ import "./ShadersInclude/bonesVertex.js";
11
+ import "./ShadersInclude/bakedVertexAnimation.js";
12
+ import "./ShadersInclude/clipPlaneVertex.js";
13
+ /** @internal */
14
+ export declare const selectionVertexShaderWGSL: {
15
+ name: string;
16
+ shader: string;
17
+ };
@@ -0,0 +1,96 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ import "./ShadersInclude/bonesDeclaration.js";
4
+ import "./ShadersInclude/bakedVertexAnimationDeclaration.js";
5
+ import "./ShadersInclude/morphTargetsVertexGlobalDeclaration.js";
6
+ import "./ShadersInclude/morphTargetsVertexDeclaration.js";
7
+ import "./ShadersInclude/clipPlaneVertexDeclaration.js";
8
+ import "./ShadersInclude/instancesDeclaration.js";
9
+ import "./ShadersInclude/morphTargetsVertexGlobal.js";
10
+ import "./ShadersInclude/morphTargetsVertex.js";
11
+ import "./ShadersInclude/instancesVertex.js";
12
+ import "./ShadersInclude/bonesVertex.js";
13
+ import "./ShadersInclude/bakedVertexAnimation.js";
14
+ import "./ShadersInclude/clipPlaneVertex.js";
15
+ const name = "selectionVertexShader";
16
+ const shader = `attribute position: vec3f;
17
+ #ifdef INSTANCES
18
+ attribute instanceSelectionId: f32;
19
+ #endif
20
+ #include<bonesDeclaration>
21
+ #include<bakedVertexAnimationDeclaration>
22
+ #include<morphTargetsVertexGlobalDeclaration>
23
+ #include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
24
+ #include<clipPlaneVertexDeclaration>
25
+ #include<instancesDeclaration>
26
+ uniform viewProjection: mat4x4f;
27
+ #ifdef STORE_CAMERASPACE_Z
28
+ uniform view: mat4x4f;
29
+ #else
30
+ uniform depthValues: vec2f;
31
+ #endif
32
+ #ifdef INSTANCES
33
+ flat varying vSelectionId: f32;
34
+ #endif
35
+ #ifdef STORE_CAMERASPACE_Z
36
+ varying vViewPosZ: f32;
37
+ #else
38
+ varying vDepthMetric: f32;
39
+ #endif
40
+ #ifdef ALPHATEST
41
+ varying vUV: vec2f;uniform diffuseMatrix: mat4x4f;
42
+ #ifdef UV1
43
+ attribute uv: vec2f;
44
+ #endif
45
+ #ifdef UV2
46
+ attribute uv2: vec2f;
47
+ #endif
48
+ #endif
49
+ #define CUSTOM_VERTEX_DEFINITIONS
50
+ @vertex
51
+ fn main(input: VertexInputs)->FragmentInputs {
52
+ #define CUSTOM_VERTEX_MAIN_BEGIN
53
+ var positionUpdated: vec3f=vertexInputs.position;
54
+ #ifdef UV1
55
+ var uvUpdated: vec2f=vertexInputs.uv;
56
+ #endif
57
+ #ifdef UV2
58
+ var uv2Updated: vec2f=vertexInputs.uv2;
59
+ #endif
60
+ #include<morphTargetsVertexGlobal>
61
+ #include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
62
+ #include<instancesVertex>
63
+ #include<bonesVertex>
64
+ #include<bakedVertexAnimation>
65
+ var worldPos: vec4f=finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;
66
+ #ifdef ALPHATEST
67
+ #ifdef UV1
68
+ vertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(uvUpdated,1.0,0.0)).xy;
69
+ #endif
70
+ #ifdef UV2
71
+ vertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(uv2Updated,1.0,0.0)).xy;
72
+ #endif
73
+ #endif
74
+ #ifdef STORE_CAMERASPACE_Z
75
+ vertexOutputs.vViewPosZ=(uniforms.view*worldPos).z;
76
+ #else
77
+ #ifdef USE_REVERSE_DEPTHBUFFER
78
+ vertexOutputs.vDepthMetric=((-vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));
79
+ #else
80
+ vertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));
81
+ #endif
82
+ #endif
83
+ #ifdef INSTANCES
84
+ vertexOutputs.vSelectionId=vertexInputs.instanceSelectionId;
85
+ #endif
86
+ #include<clipPlaneVertex>
87
+ #define CUSTOM_VERTEX_MAIN_END
88
+ }
89
+ `;
90
+ // Sideeffect
91
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
92
+ ShaderStore.ShadersStoreWGSL[name] = shader;
93
+ }
94
+ /** @internal */
95
+ export const selectionVertexShaderWGSL = { name, shader };
96
+ //# sourceMappingURL=selection.vertex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/selection.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,kDAAkD,CAAC;AAC1D,OAAO,sDAAsD,CAAC;AAC9D,OAAO,gDAAgD,CAAC;AACxD,OAAO,6CAA6C,CAAC;AACrD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,2CAA2C,CAAC;AACnD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,8BAA8B,CAAC;AACtC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,kCAAkC,CAAC;AAE1C,MAAM,IAAI,GAAG,uBAAuB,CAAC;AACrC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyEd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/bonesDeclaration\";\nimport \"./ShadersInclude/bakedVertexAnimationDeclaration\";\nimport \"./ShadersInclude/morphTargetsVertexGlobalDeclaration\";\nimport \"./ShadersInclude/morphTargetsVertexDeclaration\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/instancesDeclaration\";\nimport \"./ShadersInclude/morphTargetsVertexGlobal\";\nimport \"./ShadersInclude/morphTargetsVertex\";\nimport \"./ShadersInclude/instancesVertex\";\nimport \"./ShadersInclude/bonesVertex\";\nimport \"./ShadersInclude/bakedVertexAnimation\";\nimport \"./ShadersInclude/clipPlaneVertex\";\n\nconst name = \"selectionVertexShader\";\nconst shader = `attribute position: vec3f;\n#ifdef INSTANCES\nattribute instanceSelectionId: f32;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<clipPlaneVertexDeclaration>\n#include<instancesDeclaration>\nuniform viewProjection: mat4x4f;\n#ifdef STORE_CAMERASPACE_Z\nuniform view: mat4x4f;\n#else\nuniform depthValues: vec2f;\n#endif\n#ifdef INSTANCES\nflat varying vSelectionId: f32;\n#endif\n#ifdef STORE_CAMERASPACE_Z\nvarying vViewPosZ: f32;\n#else\nvarying vDepthMetric: f32;\n#endif\n#ifdef ALPHATEST\nvarying vUV: vec2f;uniform diffuseMatrix: mat4x4f; \n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input: VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvar positionUpdated: vec3f=vertexInputs.position;\n#ifdef UV1\nvar uvUpdated: vec2f=vertexInputs.uv;\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=vertexInputs.uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;\n#ifdef ALPHATEST\n#ifdef UV1\nvertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef UV2\nvertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(uv2Updated,1.0,0.0)).xy;\n#endif\n#endif\n#ifdef STORE_CAMERASPACE_Z\nvertexOutputs.vViewPosZ=(uniforms.view*worldPos).z;\n#else\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric=((-vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));\n#else\nvertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));\n#endif\n#endif\n#ifdef INSTANCES\nvertexOutputs.vSelectionId=vertexInputs.instanceSelectionId;\n#endif\n#include<clipPlaneVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const selectionVertexShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const selectionOutlinePixelShaderWGSL: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -0,0 +1,24 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ const name = "selectionOutlinePixelShader";
4
+ const shader = `var maskSamplerSampler: sampler;uniform maskSampler: texture_2d<f32>;var depthSamplerSampler: sampler;uniform depthSampler: texture_2d<f32>;varying vUV: vec2f;uniform screenSize: vec2f;uniform outlineColor: vec3f;uniform outlineThickness: f32;uniform occlusionStrength: f32;uniform occlusionThreshold: f32;
5
+ #define CUSTOM_FRAGMENT_DEFINITIONS
6
+ @fragment
7
+ fn main(input: FragmentInputs)->FragmentOutputs {
8
+ #define CUSTOM_FRAGMENT_MAIN_BEGIN
9
+ var texelSize: vec2f=1.0/uniforms.screenSize;var sampleOffset: vec2f=texelSize*uniforms.outlineThickness;var centerMask: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV,0.0).rg;var maskX: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,0.0),0.0).rg;var maskY: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(0.0,sampleOffset.y),0.0).rg;var maskXY: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+sampleOffset,0.0).rg;var gradient: vec3f=vec3f(
10
+ centerMask.r-maskX.r,
11
+ centerMask.r-maskY.r,
12
+ centerMask.r-maskXY.r
13
+ );var edgeStrength: f32=length(gradient);var outlineMask: f32=step(0.1,edgeStrength);
14
+ var depthCenter: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV,0.0).r;var depthX: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,0.0),0.0).r;var depthY: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(0.0,sampleOffset.y),0.0).r;var depthXY: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+sampleOffset,0.0).r;var occlusionCenter: f32=step(uniforms.occlusionThreshold,abs(centerMask.g-depthCenter));var occlusionX: f32=step(uniforms.occlusionThreshold,abs(maskX.g-depthX));var occlusionY: f32=step(uniforms.occlusionThreshold,abs(maskY.g-depthY));var occlusionXY: f32=step(uniforms.occlusionThreshold,abs(maskXY.g-depthXY));var occlusionFactor: f32=min(min(occlusionCenter,occlusionX),min(occlusionY,occlusionXY));var finalOutlineMask: f32=outlineMask*(1.0-uniforms.occlusionStrength*occlusionFactor);fragmentOutputs.color=vec4f(uniforms.outlineColor,finalOutlineMask);
15
+ #define CUSTOM_FRAGMENT_MAIN_END
16
+ }
17
+ `;
18
+ // Sideeffect
19
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
20
+ ShaderStore.ShadersStoreWGSL[name] = shader;
21
+ }
22
+ /** @internal */
23
+ export const selectionOutlinePixelShaderWGSL = { name, shader };
24
+ //# sourceMappingURL=selectionOutline.fragment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectionOutline.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/selectionOutline.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,6BAA6B,CAAC;AAC3C,MAAM,MAAM,GAAG;;;;;;;;;;;;;CAad,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"selectionOutlinePixelShader\";\nconst shader = `var maskSamplerSampler: sampler;uniform maskSampler: texture_2d<f32>;var depthSamplerSampler: sampler;uniform depthSampler: texture_2d<f32>;varying vUV: vec2f;uniform screenSize: vec2f;uniform outlineColor: vec3f;uniform outlineThickness: f32;uniform occlusionStrength: f32;uniform occlusionThreshold: f32;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvar texelSize: vec2f=1.0/uniforms.screenSize;var sampleOffset: vec2f=texelSize*uniforms.outlineThickness;var centerMask: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV,0.0).rg;var maskX: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,0.0),0.0).rg;var maskY: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(0.0,sampleOffset.y),0.0).rg;var maskXY: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+sampleOffset,0.0).rg;var gradient: vec3f=vec3f(\ncenterMask.r-maskX.r,\ncenterMask.r-maskY.r,\ncenterMask.r-maskXY.r\n);var edgeStrength: f32=length(gradient);var outlineMask: f32=step(0.1,edgeStrength); \nvar depthCenter: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV,0.0).r;var depthX: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,0.0),0.0).r;var depthY: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(0.0,sampleOffset.y),0.0).r;var depthXY: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+sampleOffset,0.0).r;var occlusionCenter: f32=step(uniforms.occlusionThreshold,abs(centerMask.g-depthCenter));var occlusionX: f32=step(uniforms.occlusionThreshold,abs(maskX.g-depthX));var occlusionY: f32=step(uniforms.occlusionThreshold,abs(maskY.g-depthY));var occlusionXY: f32=step(uniforms.occlusionThreshold,abs(maskXY.g-depthXY));var occlusionFactor: f32=min(min(occlusionCenter,occlusionX),min(occlusionY,occlusionXY));var finalOutlineMask: f32=outlineMask*(1.0-uniforms.occlusionStrength*occlusionFactor);fragmentOutputs.color=vec4f(uniforms.outlineColor,finalOutlineMask);\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const selectionOutlinePixelShaderWGSL = { name, shader };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onerjs/core",
3
- "version": "8.37.6",
3
+ "version": "8.37.8",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
package/scene.d.ts CHANGED
@@ -2046,13 +2046,13 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
2046
2046
  */
2047
2047
  getLastTransformNodeById(id: string): Nullable<TransformNode>;
2048
2048
  /**
2049
- * Gets a the last added node (Mesh, Camera, Light) using a given Id
2049
+ * Gets a the last added node (Mesh, Camera, Light, Bone) using a given Id
2050
2050
  * @param id defines the Id to search for
2051
2051
  * @returns the found node or null if not found at all
2052
2052
  */
2053
2053
  getLastEntryById(id: string): Nullable<Node>;
2054
2054
  /**
2055
- * Gets a node (Mesh, Camera, Light) using a given Id
2055
+ * Gets a node (Mesh, Camera, Light, Bone) using a given Id
2056
2056
  * @param id defines the Id to search for
2057
2057
  * @returns the found node or null if not found at all
2058
2058
  */
package/scene.js CHANGED
@@ -3246,7 +3246,7 @@ export class Scene {
3246
3246
  return null;
3247
3247
  }
3248
3248
  /**
3249
- * Gets a the last added node (Mesh, Camera, Light) using a given Id
3249
+ * Gets a the last added node (Mesh, Camera, Light, Bone) using a given Id
3250
3250
  * @param id defines the Id to search for
3251
3251
  * @returns the found node or null if not found at all
3252
3252
  */
@@ -3272,10 +3272,18 @@ export class Scene {
3272
3272
  return this.lights[index];
3273
3273
  }
3274
3274
  }
3275
+ for (index = this.skeletons.length - 1; index >= 0; index--) {
3276
+ const skeleton = this.skeletons[index];
3277
+ for (let boneIndex = skeleton.bones.length - 1; boneIndex >= 0; boneIndex--) {
3278
+ if (skeleton.bones[boneIndex].id === id) {
3279
+ return skeleton.bones[boneIndex];
3280
+ }
3281
+ }
3282
+ }
3275
3283
  return null;
3276
3284
  }
3277
3285
  /**
3278
- * Gets a node (Mesh, Camera, Light) using a given Id
3286
+ * Gets a node (Mesh, Camera, Light, Bone) using a given Id
3279
3287
  * @param id defines the Id to search for
3280
3288
  * @returns the found node or null if not found at all
3281
3289
  */