@arcgis/core 5.2.0-next.44 → 5.2.0-next.45
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0e64e20fedfe01a1985f.js +1 -0
- package/assets/esri/core/workers/chunks/15351354afcbf840a23d.js +29 -0
- package/assets/esri/core/workers/chunks/2c0d92c0e3511775401a.js +29 -0
- package/assets/esri/core/workers/chunks/{f1f3fe9d2d96578f4f6b.js → 52efa4ded11c1e71f04f.js} +1 -1
- package/assets/esri/core/workers/chunks/{e5c19e9b6fa53abdca8c.js → 728ea88e7d4733230e1f.js} +72 -73
- package/assets/esri/core/workers/chunks/{94cebc34e49da1e295ed.js → 8026cc0065f6520c4161.js} +1 -1
- package/assets/esri/core/workers/chunks/{7684f0c771d312e05bb4.js → ad5c2b0de6713d0a93a4.js} +58 -58
- package/assets/esri/core/workers/chunks/{9b1199104a6822ab7340.js → ae9f9e975d7a9d442fa5.js} +1 -1
- package/assets/esri/core/workers/chunks/b3cd17daf5a297b96705.js +29 -0
- package/assets/esri/core/workers/chunks/{c316234837b7ca406b1c.js → c4b13124a9cfc78c42a6.js} +6 -6
- package/assets/esri/core/workers/chunks/c5e36544b2d1792e4c5f.js +1 -0
- package/assets/esri/core/workers/chunks/{96d5fed0235558c0e348.js → e9c48630757bea465b7e.js} +1 -1
- package/assets/esri/core/workers/chunks/{305ee2dd597c48a38e64.js → ed988360264574cd8f6b.js} +1 -1
- package/chunks/CutFillComposition.glsl.js +2 -2
- package/chunks/CutFillReduction.glsl.js +1 -1
- package/chunks/EmissionComposite.glsl.js +2 -0
- package/chunks/FocusAreaColor.glsl.js +1 -1
- package/chunks/Fog.glsl.js +20 -20
- package/chunks/GlobalIllumination.glsl.js +25 -25
- package/chunks/GlowBlur.glsl.js +16 -18
- package/chunks/GlowComposite.glsl.js +35 -0
- package/chunks/Laserline.glsl.js +13 -13
- package/chunks/LaserlinePath.glsl.js +11 -10
- package/chunks/Precipitation.glsl.js +6 -6
- package/chunks/ShadowCastVisualize.glsl.js +2 -2
- package/chunks/ShadowHighlight.glsl.js +3 -3
- package/chunks/Viewshed.glsl.js +3 -3
- package/config.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/types.d.ts +7 -0
- package/kernel.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/3d/environment/CloudyWeather.js +1 -1
- package/views/3d/environment/FoggyWeather.js +1 -1
- package/views/3d/environment/RainyWeather.js +1 -1
- package/views/3d/environment/SnowyWeather.js +1 -1
- package/views/3d/environment/SunnyWeather.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
- package/views/3d/support/debugFlags.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/intersectionHitUtils.js +2 -0
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +12 -12
- package/views/3d/webgl-engine/collections/Component/UniformComponentParameters.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +8 -0
- package/views/3d/webgl-engine/core/shaderLibrary/util/blendEmission.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaVisualization.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowBlur.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposite.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/glow/GlowCompositeTechnique.js +2 -0
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/Laserline.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
- package/views/3d/webgl-engine/effects/precipitation/PrecipitationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillComputation.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillVisualization.js +1 -1
- package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +2 -0
- package/views/3d/webgl-engine/lib/EmissionComposite.js +2 -0
- package/views/3d/webgl-engine/lib/EmissionCompositeTechnique.js +2 -0
- package/views/3d/webgl-engine/lib/HUDIntersectorResult.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/PolygonIntersectionResults.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/CutFillComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/EmissiveTechniqueConfiguration.js +2 -0
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
- package/views/SceneView.d.ts +4 -3
- package/views/SceneView.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/support/TextureCompressionWorkerHandle.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/assets/esri/core/workers/chunks/5b937c405788fd14be8b.js +0 -30
- package/assets/esri/core/workers/chunks/8a01fe8d78ca85ea4784.js +0 -1
- package/assets/esri/core/workers/chunks/a38a7e3a5aa9294ab918.js +0 -30
- package/assets/esri/core/workers/chunks/b75db3b1becf8265ec59.js +0 -30
- package/assets/esri/core/workers/chunks/ca419858910af5505d3d.js +0 -1
- package/chunks/GlowComposition.glsl.js +0 -39
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +0 -9
- package/views/3d/webgl-engine/effects/fog/FogTechniqueConfiguration.js +0 -2
- package/views/3d/webgl-engine/effects/glow/GlowBlurTechniqueConfiguration.js +0 -2
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +0 -2
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +0 -2
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{create as e}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{ScreenSpacePass as l}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{
|
|
2
|
+
import{create as e}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{ScreenSpacePass as l}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{blendEmission as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/blendEmission.glsl.js";import{ColorConversion as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{Float4PassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as a}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{NoParameters as c}from"../views/webgl/NoParameters.js";import{ShaderBuilder as u}from"../views/webgl/ShaderBuilder.js";class m extends c{constructor(){super(...arguments),this.borderColor=e()}}function n(e){const c=new u;return c.include(l),c.outputs.add("fragColor","vec4",0),c.fragment.include(o),c.fragment.uniforms.add(new s("cutVolume",e=>e.cutVolume),new s("fillVolume",e=>e.fillVolume),new s("cutFillMask",e=>e.mask),new s("sceneDepth",e=>e.sceneDepth),new s("groundDepth",e=>e.groundDepth),new i("pixelRatio",(e,l)=>l.camera.pixelRatio),new t("borderColor",e=>e.borderColor)).main.add(a`vec4 cutVolume = texture(cutVolume, uv);
|
|
3
3
|
vec4 fillVolume = texture(fillVolume, uv);
|
|
4
4
|
float sceneDepth = texture(sceneDepth, uv).r;
|
|
5
5
|
float groundDepth = texture(groundDepth, uv).r;
|
|
@@ -26,4 +26,4 @@ float alpha = borderAlpha + cutFillAlpha;
|
|
|
26
26
|
float borderMix = alpha > 0.0 ? borderAlpha / alpha : 0.0;
|
|
27
27
|
vec3 color = mix(cutFillColor, borderColor.rgb, borderMix);
|
|
28
28
|
float alphaIntegral = 1.0 - (1.0 - cutAlpha) * (1.0 - fillAlpha) * (1.0 - borderAlpha);
|
|
29
|
-
fragColor = premultiplyAlpha(vec4(color, alphaIntegral));`),e}const
|
|
29
|
+
fragColor = premultiplyAlpha(vec4(color, alphaIntegral));`),c.include(r,e),c}const p=Object.freeze(Object.defineProperty({__proto__:null,CutFillCompositionPassParameters:m,build:n},Symbol.toStringTag,{value:"Module"}));export{m as C,p as a,n as b};
|
|
@@ -7,7 +7,7 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
7
7
|
vec2 t2 = texelFetch(cutFillDepthTexture, iuv + ivec2(0, 1), 0).rg;
|
|
8
8
|
vec2 t3 = texelFetch(cutFillDepthTexture, iuv + ivec2(1, 1), 0).rg;
|
|
9
9
|
|
|
10
|
-
${t(0===i,"\n vec2 totalDepth = t0 + t1 + t2 + t3;\n
|
|
10
|
+
${t(0===i,"\n vec2 totalDepth = t0 + t1 + t2 + t3;\n fragColor = vec4(totalDepth, 0.0, 0.0);\n ")}
|
|
11
11
|
|
|
12
12
|
${t(1===i," \n float min01 = min(t0.r, t1.r);\n float minCoordsPacked01 = mix(t0.g, t1.g, float(t1.r < t0.r));\n\n float min23 = min(t2.r, t3.r);\n float minCoordsPacked23 = mix(t2.g, t3.g, float(t3.r < t2.r));\n\n float minValue = min(min01, min23);\n float minCoordsPacked = mix(minCoordsPacked01, minCoordsPacked23, float(min23 < min01));\n\n fragColor = vec4(minValue, minCoordsPacked, 0.0, 0.0);\n ")}
|
|
13
13
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{FloatPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{Texture2DPassUniform as r}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{ToneMapping as o}from"../views/3d/webgl-engine/shaders/ToneMapping.glsl.js";import{NoParameters as i}from"../views/webgl/NoParameters.js";import{ShaderBuilder as n}from"../views/webgl/ShaderBuilder.js";class t extends i{constructor(){super(...arguments),this.inputScale=1}}function a(){const i=new n,t=i.fragment;return i.include(e,!0),i.outputs.add("fragColor","vec4",0),t.include(o),t.uniforms.add(new r("emissionTexture",({emission:e})=>e),new s("inputScale",({inputScale:e},{lighting:s})=>e*(2-s.noonFactor))).main.add("\n vec3 emission = texture(emissionTexture, uv).rgb * inputScale;\n fragColor = vec4(tonemapKhronosNeutral(emission), 0.0);\n "),i}const l=Object.freeze(Object.defineProperty({__proto__:null,EmissionCompositePassParameters:t,build:a},Symbol.toStringTag,{value:"Module"}));export{t as E,l as a,a as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{signal as e}from"../core/signal.js";import{ScreenSpacePass as r}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{FloatPassUniform as o}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{IntegerPassUniform as
|
|
2
|
+
import{signal as e}from"../core/signal.js";import{ScreenSpacePass as r}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{FloatPassUniform as o}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{IntegerPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Texture2DPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{NoParameters as t}from"../views/webgl/NoParameters.js";import{ShaderBuilder as c}from"../views/webgl/ShaderBuilder.js";class n extends t{constructor(){super(...arguments),this.effect=0,this.fadeFactor=e(1)}}function f(e){const t=new c;return t.include(r),t.outputs.add("fragColor","vec4",0),t.fragment.uniforms.add(new s("colorTexture",e=>e.color),new s("focusArea",e=>e.focusArea),new a("focusAreaEffectMode",e=>e.effect),new o("fadeFactor",e=>e.fadeFactor.value)).constants.add("EffectBright","int",0).main.add("\n float mask = texture(focusArea, uv).r;\n \n if (focusAreaEffectMode == EffectBright) {\n vec4 color = texture(colorTexture, uv);\n float luminance = color.r * 0.25 + color.g * 0.5 + color.b * 0.25;\n fragColor = mask > 0.0 ? color : mix(color, vec4(0.55 * luminance + 0.45), fadeFactor);\n } else {\n if(mask > 0.0) discard;\n fragColor = vec4(vec3(0.0), fadeFactor * 0.67);\n }\n "),e.hasEmissive&&(t.outputs.add("fragEmission","vec4",1),t.fragment.main.add("\n if (focusAreaEffectMode == EffectBright)\n fragEmission = vec4(vec3(0.0), fadeFactor * 0.67);\n else\n fragEmission = vec4(vec3(0.0), fadeFactor * 0.9);\n ")),t}const i=Object.freeze(Object.defineProperty({__proto__:null,FocusAreaColorPassParameters:n,build:f},Symbol.toStringTag,{value:"Module"}));export{n as F,i as a,f as b};
|
package/chunks/Fog.glsl.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{create as e}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadDepth as o}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{Gamma as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
import{create as e}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadDepth as o}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{Gamma as i}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{ColorConversion as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{Float3PassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as n}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{DistanceFalloffPassParameters as m,getDistanceFalloff as g}from"../views/3d/webgl-engine/effects/raymarching/DistanceFalloff.glsl.js";import{ScreenSpacePassAtmosphere as d}from"../views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js";import{ToneMapping as c}from"../views/3d/webgl-engine/shaders/ToneMapping.glsl.js";import{ShaderBuilder as f}from"../views/webgl/ShaderBuilder.js";class p extends m{constructor(){super(...arguments),this.color=e(),this.strength=0,this.amount=0,this.fogColorDistanceWeight=.85,this.inputScale=1}}function u({hasEmissive:e}){const m=new f;m.include(d,{needUVs:!0,needEyeDirection:!0});const{outputs:p,fragment:u}=m;return p.add("fragColor","vec4",0),u.uniforms.add(new t("depthTexture",e=>e.mainDepth),new s("fogStrength",e=>e.strength),new s("fogAmount",e=>e.amount),new a("fogColor",e=>e.color),new s("fogColorDistanceWeight",e=>e.fogColorDistanceWeight)).constants.add("f16Epsilon","float",6103515625e-14),e&&(p.add("fragEmission","vec4",1),u.uniforms.add(new l("emissionTexture",({emission:e})=>e?.attachment),new s("inputScale",({inputScale:e})=>e))),u.include(g),u.include(i),u.include(c),u.include(o),u.include(r),u.main.add(n`vec3 rayDir = normalize(worldRay);
|
|
3
|
+
float mainDepth = -1.0;
|
|
4
|
+
float depthSample = depthFromTexture(depthTexture, uv);
|
|
5
|
+
if(depthSample < 1.0 && depthSample > 0.0){
|
|
6
|
+
vec3 cameraSpaceRay = normalize(eyeDir);
|
|
7
|
+
cameraSpaceRay /= cameraSpaceRay.z;
|
|
8
|
+
cameraSpaceRay *= linearizeDepth(depthSample);
|
|
9
|
+
mainDepth = max(0.0, length(cameraSpaceRay));
|
|
10
|
+
}
|
|
11
|
+
float fogAmount = fogAmount * getDistanceFalloff(mainDepth, rayDir, fogStrength);`),e&&u.main.add(n`vec3 emission = texture(emissionTexture, uv).rgb * inputScale;
|
|
12
|
+
vec3 emissionHSV = rgb2hsv(tonemapKhronosNeutral(emission));
|
|
13
|
+
vec3 fogHSV = rgb2hsv(fogColor);
|
|
14
|
+
float light = emissionHSV.b;
|
|
15
|
+
float saturation = pow(light, 0.2);
|
|
16
|
+
vec3 fogColor = vec3(emissionHSV.r,
|
|
17
|
+
emissionHSV.g * saturation,
|
|
18
|
+
fogHSV.b + light);
|
|
19
|
+
fogColor = hsv2rgb(fogColor);
|
|
20
|
+
float fogDamping = fogAmount < 1.0 ? min(-log(1.0 - fogAmount) * 0.1, 16.0) : 16.0;
|
|
21
|
+
fragEmission = vec4(max(emission - fogDamping, 0.0) / inputScale, 1.0);`),u.main.add("fragColor = delinearizeGamma(vec4(tonemapACES(fogColor * fogAmount), fogAmount));"),m}const h=Object.freeze(Object.defineProperty({__proto__:null,FogPassParameters:p,build:u},Symbol.toStringTag,{value:"Module"}));export{p as F,h as a,u as b};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepthLastFrame as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import{Gamma as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{addMainLightDirection as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{ScreenSpaceRayMarching as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import{CameraSpace as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{
|
|
2
|
+
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepthLastFrame as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import{Gamma as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{addMainLightDirection as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{ScreenSpaceRayMarching as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import{CameraSpace as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{FloatBindUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as s,If as c}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{GlobalIlluminationColorQuantization as u}from"../views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationColorQuantization.glsl.js";import{floatBlendReductionFactor as p}from"../views/3d/webgl-engine/shaders/floatBlendScale.glsl.js";import{ColorAttachment1 as g,SizedPixelFormat as f}from"../views/webgl/enums.js";import{NoParameters as x}from"../views/webgl/NoParameters.js";import{ShaderBuilder as v}from"../views/webgl/ShaderBuilder.js";const M=.01,b=.008,y=.002,w=.5,S=.02,W=.1,D=.008,F=.012,R=.008,j=40,B=.095,I=.008,C=60,z=2,G=.0039,P=.25,T=.15,E=25,$=.15,L=.5,O=1,V=1,U=16;class N extends x{constructor(){super(...arguments),this.projScale=1,this.scaleGlobalIllumination=1,this.accumulatedFrames=0,this.temporalSampleFrame=0,this.rayMarchMinReach=$,this.rayMarchMaxReach=L,this.rayMarchWorldReach=E,this.rayMarchMinReachEmissionWeight=O,this.rayMarchMaxReachEmissionWeight=V,this.rayMarchMaxSteps=U,this.colorBleedWeight=T}}function k(x){const T=new v,E=T.fragment;T.include(e),T.include(i),r(E),E.include(a),E.include(t),E.include(u),T.include(o,x),E.uniforms.add(new d("normalMap",e=>e.normalTexture),new d("depthMap",e=>e.depthTexture),new h("lastFrameColorTexture",e=>e.reprojection.lastFrameColor?.getTexture()),new h("lastFrameDepthTexture",e=>e.reprojection.lastFrameDepth?.attachment),new h("lastFrameGlobalIlluminationTexture",e=>e.globalIllumination?.getTexture()),new h("lastFrameGlobalIlluminationWeightTexture",e=>e.globalIllumination?.getTexture(g)),new m("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new m("view",e=>e.camera.viewMatrix),new n("accumulatedFrames",e=>e.accumulatedFrames),new n("temporalSampleFrame",e=>e.temporalSampleFrame),new n("scaleGlobalIllumination",e=>e.scaleGlobalIllumination)),E.uniforms.add(new n("rayMarchMinReach",e=>e.rayMarchMinReach),new n("rayMarchMaxReach",e=>e.rayMarchMaxReach),new n("rayMarchWorldReach",e=>e.rayMarchWorldReach),new n("rayMarchMinReachEmissionWeight",e=>e.rayMarchMinReachEmissionWeight),new n("rayMarchMaxReachEmissionWeight",e=>e.rayMarchMaxReachEmissionWeight),new n("rayMarchMaxSteps",e=>e.rayMarchMaxSteps),new n("colorBleedWeight",e=>e.colorBleedWeight));const{hasEmission:$,hasColor:L}=x;return $&&E.uniforms.add(new l("inputScale",e=>e.reprojection.lastFrameEmission?.attachment.descriptor.internalFormat===f.RGBA8?p:1),new h("lastFrameEmissionTexture",e=>e.reprojection.lastFrameEmission?.attachment)),E.code.add(s`
|
|
3
3
|
float computeIdleColorBlendWeight(float accumulatedFrames) {
|
|
4
4
|
float idleColorBlendProgress = clamp(
|
|
5
|
-
accumulatedFrames / ${
|
|
5
|
+
accumulatedFrames / ${s.float(j)},
|
|
6
6
|
0.0,
|
|
7
7
|
1.0
|
|
8
8
|
);
|
|
9
9
|
return mix(
|
|
10
|
-
${
|
|
11
|
-
${
|
|
10
|
+
${s.float(F)},
|
|
11
|
+
${s.float(R)},
|
|
12
12
|
idleColorBlendProgress
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
float computeIdleOcclusionBlendWeight(float accumulatedFrames) {
|
|
17
17
|
float idleOcclusionBlendProgress = clamp(
|
|
18
|
-
accumulatedFrames / ${
|
|
18
|
+
accumulatedFrames / ${s.float(C)},
|
|
19
19
|
0.0,
|
|
20
20
|
1.0
|
|
21
21
|
);
|
|
22
22
|
return mix(
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
pow(idleOcclusionBlendProgress, ${
|
|
23
|
+
${s.float(B)},
|
|
24
|
+
${s.float(I)},
|
|
25
|
+
pow(idleOcclusionBlendProgress, ${s.float(z)})
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -77,7 +77,7 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
77
77
|
|
|
78
78
|
return value * 2.0 - 1.0;
|
|
79
79
|
}
|
|
80
|
-
`),
|
|
80
|
+
`),T.outputs.add("fragGlobalIllumination","vec4",0),T.outputs.add("fragWeight","float",1),E.main.add(s`
|
|
81
81
|
float depth = depthFromTexture(depthMap, uv);
|
|
82
82
|
|
|
83
83
|
// Early out if depth is out of range, such as in the sky
|
|
@@ -117,7 +117,7 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
117
117
|
float idleColorBlendWeight = computeIdleColorBlendWeight(accumulatedFrames);
|
|
118
118
|
float idleOcclusionBlendWeight = computeIdleOcclusionBlendWeight(accumulatedFrames);
|
|
119
119
|
float reprojectionDepthMismatch = abs((lastFrameDepthViewPos + reprojectedViewPos.z) / max(lastFrameDepthViewPos, reprojectedViewPos.z));
|
|
120
|
-
bool hasReprojectionMismatch = reprojectionDepthMismatch > ${
|
|
120
|
+
bool hasReprojectionMismatch = reprojectionDepthMismatch > ${s.float(M)};
|
|
121
121
|
bool isScaledGlobalIllumination = scaleGlobalIllumination < 1.0;
|
|
122
122
|
bool isLowQualityEdgePixel = isScaledGlobalIllumination && isEdgeDepth(currentPixelDepth, uv);
|
|
123
123
|
bool resetColorHistory = false;
|
|
@@ -126,7 +126,7 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
126
126
|
if (hasReprojectionMismatch) {
|
|
127
127
|
if (isLowQualityEdgePixel) {
|
|
128
128
|
steps = 1;
|
|
129
|
-
occlusionBlendWeight = ${
|
|
129
|
+
occlusionBlendWeight = ${s.float(b)};
|
|
130
130
|
resetColorHistory = true;
|
|
131
131
|
} else {
|
|
132
132
|
steps = 6;
|
|
@@ -135,15 +135,15 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
135
135
|
}
|
|
136
136
|
} else {
|
|
137
137
|
steps = 1;
|
|
138
|
-
if (historyOcclusionBlendWeight > ${
|
|
139
|
-
occlusionBlendWeight = ${
|
|
140
|
-
colorBlendWeight = ${
|
|
141
|
-
} else if (historyOcclusionBlendWeight > ${
|
|
138
|
+
if (historyOcclusionBlendWeight > ${s.float(w)}) {
|
|
139
|
+
occlusionBlendWeight = ${s.float(W)};
|
|
140
|
+
colorBlendWeight = ${s.float(D)};
|
|
141
|
+
} else if (historyOcclusionBlendWeight > ${s.float(S)}) {
|
|
142
142
|
occlusionBlendWeight = historyOcclusionBlendWeight - 0.05;
|
|
143
|
-
colorBlendWeight = ${
|
|
143
|
+
colorBlendWeight = ${s.float(D)};
|
|
144
144
|
} else {
|
|
145
|
-
occlusionBlendWeight = isScaledGlobalIllumination ? ${
|
|
146
|
-
colorBlendWeight = isScaledGlobalIllumination ? ${
|
|
145
|
+
occlusionBlendWeight = isScaledGlobalIllumination ? ${s.float(b)} : idleOcclusionBlendWeight;
|
|
146
|
+
colorBlendWeight = isScaledGlobalIllumination ? ${s.float(y)} : idleColorBlendWeight;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -173,14 +173,14 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
173
173
|
);
|
|
174
174
|
|
|
175
175
|
if (hit.z > 0.0) {
|
|
176
|
-
${
|
|
176
|
+
${c(L,s`
|
|
177
177
|
// Emission and color bleed - Reproject the current receiver and sampled hit to estimate bounced color
|
|
178
178
|
vec3 receiverColor = texture(lastFrameColorTexture, reprojectedCoordinate.xy).rgb;
|
|
179
179
|
|
|
180
180
|
vec2 hitReprojectedCoordinate = reprojectionCoordinate(hit);
|
|
181
181
|
vec3 sourceColor = texture(lastFrameColorTexture, hitReprojectedCoordinate).rgb;
|
|
182
182
|
vec3 sourceColorLinear = linearizeGamma(sourceColor);
|
|
183
|
-
vec3 sourceEmission = ${
|
|
183
|
+
vec3 sourceEmission = ${c($,"texture(lastFrameEmissionTexture, hitReprojectedCoordinate).xyz * inputScale","vec3(0.0)")};
|
|
184
184
|
|
|
185
185
|
float emissionWeight = mix(
|
|
186
186
|
rayMarchMinReachEmissionWeight,
|
|
@@ -201,17 +201,17 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
201
201
|
|
|
202
202
|
// Rendering trick add noise to reduce accumulation artifacts
|
|
203
203
|
float accumulationDither = occlusionBlendWeight < 1.0
|
|
204
|
-
? randomDirectionSample.b * ${
|
|
204
|
+
? randomDirectionSample.b * ${s.float(G)}
|
|
205
205
|
: 0.0;
|
|
206
206
|
|
|
207
|
-
${
|
|
207
|
+
${c(L,s`
|
|
208
208
|
// Accumulate color
|
|
209
209
|
vec3 lastFrameColor = lastFrameGlobalIllumination.rgb;
|
|
210
|
-
float colorDitherScale = isScaledGlobalIllumination ? ${
|
|
210
|
+
float colorDitherScale = isScaledGlobalIllumination ? ${s.float(P)} : 1.0;
|
|
211
211
|
fragGlobalIllumination.rgb = resetColorHistory
|
|
212
212
|
? vec3(0.0)
|
|
213
213
|
: mix(lastFrameColor + accumulationDither * colorDitherScale, fragGlobalIllumination.rgb, colorBlendWeight);
|
|
214
|
-
`,
|
|
214
|
+
`,s`
|
|
215
215
|
fragGlobalIllumination.rgb = vec3(0.0);
|
|
216
216
|
`)}
|
|
217
217
|
fragGlobalIllumination.rgb = quantizeGlobalIlluminationColor(fragGlobalIllumination.rgb);
|
|
@@ -220,4 +220,4 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
220
220
|
fragGlobalIllumination.a = mix(lastFrameGlobalIllumination.a + accumulationDither, fragGlobalIllumination.a, occlusionBlendWeight);
|
|
221
221
|
|
|
222
222
|
fragWeight = occlusionBlendWeight;
|
|
223
|
-
`),
|
|
223
|
+
`),T}const H=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationPassParameters:N,build:k,defaultColorBleedWeight:T,defaultRayMarchMaxReach:L,defaultRayMarchMaxReachEmissionWeight:V,defaultRayMarchMaxSteps:U,defaultRayMarchMinReach:$,defaultRayMarchMinReachEmissionWeight:O,defaultRayMarchWorldReach:E},Symbol.toStringTag,{value:"Module"}));export{N as G,H as a,U as b,k as c,L as d,T as e,V as f,$ as g,O as h,E as i};
|
package/chunks/GlowBlur.glsl.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{normalize as e}from"../core/arrayUtils.js";import{gauss as r}from"../core/mathUtils.js";import{create as o}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ScreenSpacePass as
|
|
3
|
-
|
|
4
|
-
${h}
|
|
2
|
+
import{normalize as e}from"../core/arrayUtils.js";import{gauss as r}from"../core/mathUtils.js";import{create as o,ONES as i}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ScreenSpacePass as t}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{Gamma as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{BooleanDrawUniform as s}from"../views/3d/webgl-engine/core/shaderModules/BooleanDrawUniform.js";import{Float2DrawUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js";import{FloatDrawUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatDrawUniform.js";import{glsl as m}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DDrawUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";import{NoParameters as u}from"../views/webgl/NoParameters.js";import{ShaderBuilder as d}from"../views/webgl/ShaderBuilder.js";class f extends u{constructor(){super(...arguments),this.inputScale=1,this.isHorizontal=!0,this.level=0,this.size=o()}}function w(){const e=new d,r=e.fragment;e.include(t),r.include(l);const o=7,u=2;return r.uniforms.add(new c("colorTexture",e=>e.input),new s("isHorizontal",({isHorizontal:e})=>e),new n("level",({isHorizontal:e,level:r})=>e?Math.max(0,r-1):0),new n("inputScale",({inputScale:e})=>e),new a("size",({isHorizontal:e,size:r})=>e?i:r)).constants.add("sampleCount","int",o).code.add(m`
|
|
3
|
+
${v(o,u)}
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
vec3 blurUniformSamples() {
|
|
6
|
+
vec2 uv = uv * size;
|
|
7
|
+
vec2 texelSize = 1.0 / vec2(textureSize(colorTexture, int(level)));
|
|
8
|
+
vec2 offset = isHorizontal ? vec2(2.0 * texelSize.x, 0.0) : vec2(0.0, 2.0 * texelSize.y);
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
vec2 pixelCenterShift = 0.5 / size;
|
|
10
|
+
float middle = float(sampleCount - 1) * 0.5;
|
|
11
|
+
vec3 result = vec3(0.0);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
for(int i = 0; i < sampleCount; ++i) {
|
|
14
|
+
vec2 suv = clamp(uv + offset * (float(i) - middle), texelSize, size - texelSize);
|
|
15
|
+
result += textureLod(colorTexture, suv, level).rgb * inputScale * weights1D[i];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// for the mipmap, we double the energy at each level to preserve small feature information better
|
|
19
|
+
return result * (isHorizontal ? 1.0 : 2.0);
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
`).main.add(n`fragColor = vec4(blurUniformSamples(), 0.0);`),f}const v=Object.freeze(Object.defineProperty({__proto__:null,GlowBlurPassParameters:f,build:m},Symbol.toStringTag,{value:"Module"}));export{f as G,v as a,m as b};
|
|
21
|
+
`).main.add(m`fragColor = vec4(blurUniformSamples(), 0.0);`),e}function v(o,i){const t=new Array(o).fill(0).map((e,t)=>r(t-Math.floor(o/2),i));return e(t),t.reduce((e,r,o)=>`${e}${0===o?"":","} ${r.toFixed(15)}`,"float weights1D["+o+"] = float["+o+"](")+");"}const p=Object.freeze(Object.defineProperty({__proto__:null,GlowBlurDrawParameters:f,build:w,weights:v},Symbol.toStringTag,{value:"Module"}));export{f as G,p as a,w as b,v as w};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{ReadDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{Gamma as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{FloatPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as t}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{DistanceFalloffPassParameters as o,getDistanceFalloff as r}from"../views/3d/webgl-engine/effects/raymarching/DistanceFalloff.glsl.js";import{floatBlendScale as n}from"../views/3d/webgl-engine/shaders/floatBlendScale.glsl.js";import{ScreenSpacePassAtmosphere as m}from"../views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js";import{ToneMapping as d}from"../views/3d/webgl-engine/shaders/ToneMapping.glsl.js";import{ShaderBuilder as p}from"../views/webgl/ShaderBuilder.js";class g extends o{constructor(){super(...arguments),this.mipmapLevels=1,this.boost=1,this.scattering=1e-4}}function c(o){const g=new p,c=g.fragment;g.include(m,{needUVs:!0,needEyeDirection:!0}),c.include(s),c.include(r),c.include(e),c.include(d),c.include(n,o),g.outputs.add("fragEmission","vec3",1);const f=1.5;return c.uniforms.add(new l("emissionTexture",({emission:e})=>e?.attachment),new a("depthTexture",({mainDepth:e})=>e),new i("scattering",({scattering:e})=>e),new i("boost",({boost:e})=>e),new i("levels",({mipmapLevels:e})=>e),new l("mipmapTexture",({mipmapTexture:e})=>e?.getTexture())).constants.add("sigmaSq","float",f).constants.add("weightEpsilon","float",.001).constants.add("gaussCoefficient","float",1/Math.sqrt(2*Math.PI*f)).code.add(t`vec3 readEmission(float level) {
|
|
3
|
+
return (level < 1.0 ?
|
|
4
|
+
texture(emissionTexture, uv).rgb * floatBlendInputScale * (1.0 - level) +
|
|
5
|
+
textureLod(mipmapTexture, uv, 0.0).rgb * level * 0.5 :
|
|
6
|
+
textureLod(mipmapTexture, uv, level - 1.0).rgb) / pow(2.0, level);
|
|
7
|
+
}
|
|
8
|
+
float gauss(float x) {
|
|
9
|
+
float expon = -(pow(x, 2.0) / (2.0 * sigmaSq));
|
|
10
|
+
return gaussCoefficient * exp(expon);
|
|
11
|
+
}`).main.add(t`float mainDepth = -1.0;
|
|
12
|
+
float depthSample = depthFromTexture(depthTexture, uv);
|
|
13
|
+
if(depthSample < 1.0 && depthSample > 0.0){
|
|
14
|
+
vec3 cameraSpaceRay = normalize(eyeDir);
|
|
15
|
+
cameraSpaceRay /= cameraSpaceRay.z;
|
|
16
|
+
cameraSpaceRay *= linearizeDepth(depthSample);
|
|
17
|
+
mainDepth = max(0.0, length(cameraSpaceRay));
|
|
18
|
+
}
|
|
19
|
+
vec3 rayDir = normalize(worldRay);
|
|
20
|
+
float dispersionPerPixel = getDistanceFalloff(mainDepth, rayDir, scattering);
|
|
21
|
+
float mainLevel = pow(dispersionPerPixel, 16.0) * levels;
|
|
22
|
+
float weights = 0.0;
|
|
23
|
+
vec3 emission = vec3(0.0);
|
|
24
|
+
for(float level = 0.0; level < levels; level += 1.0) {
|
|
25
|
+
float dist = (level - mainLevel) / levels;
|
|
26
|
+
float scale = (sign(dist) > 0.0 ? 1.0 : -5.0) /
|
|
27
|
+
(1.0 + boost * 0.5);
|
|
28
|
+
float weight = gauss(scale * dist * 10.0 / (10.0 * dispersionPerPixel + 0.6));
|
|
29
|
+
weight = (dist > 0.2 ? weight * dist * 5.0 : weight);
|
|
30
|
+
if(weight > weightEpsilon) {
|
|
31
|
+
emission += readEmission(level) * weight;
|
|
32
|
+
weights += weight;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
fragEmission = emission * (1.0 + boost * 0.3) / weights;`),g}const f=Object.freeze(Object.defineProperty({__proto__:null,GlowCompositePassParameters:g,build:c},Symbol.toStringTag,{value:"Module"}));export{g as G,f as a,c as b};
|
package/chunks/Laserline.glsl.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{deg2rad as e}from"../core/mathUtils.js";import{set as i}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{subtract as n,normalize as a,length as o,distance as r,transformMat4 as l,copy as s,cross as c,add as d}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as p}from"../core/libs/gl-matrix-2/math/vec4.js";import{create as g}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{pointAt as
|
|
2
|
+
import{deg2rad as e}from"../core/mathUtils.js";import{set as i}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{subtract as n,normalize as a,length as o,distance as r,transformMat4 as l,copy as s,cross as c,add as d}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as p}from"../core/libs/gl-matrix-2/math/vec4.js";import{create as g}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{pointAt as m}from"../geometry/support/lineSegment.js";import{fromPositionAndNormal as h,create as u}from"../geometry/support/plane.js";import{Laserline as w}from"../views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js";import{ScreenSpacePass as x}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{blendEmission as v}from"../views/3d/webgl-engine/core/shaderLibrary/util/blendEmission.glsl.js";import{Float2PassUniform as P}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as b}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as D}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as M}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatBindUniform as S}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as C}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as L}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{ShaderBuilder as A}from"../views/webgl/ShaderBuilder.js";const j=e(6);function y(e){const i=new A;i.include(x),i.include(w,e);const{fragment:t,outputs:c}=i;c.add("fragColor","vec4",0);const{lineVerticalPlaneEnabled:d,heightManifoldEnabled:f,pointDistanceEnabled:g,intersectsLineEnabled:m,spherical:h}=e;if(d||f)if(t.uniforms.add(new C("maxPixelDistance",(e,i)=>f?2*i.camera.computeScreenPixelSizeAt(e.heightManifoldTarget):2*i.camera.computeScreenPixelSizeAt(e.lineVerticalPlaneSegment.origin))),t.code.add(L`float planeDistancePixels(vec4 plane, vec3 pos) {
|
|
3
3
|
float dist = dot(plane.xyz, pos) + plane.w;
|
|
4
4
|
float width = fwidth(dist);
|
|
5
5
|
dist /= min(width, maxPixelDistance);
|
|
6
6
|
return abs(dist);
|
|
7
|
-
}`),
|
|
7
|
+
}`),h){const e=(e,i,t)=>l(e,i.heightManifoldTarget,t.camera.viewMatrix),i=(e,i)=>l(e,[0,0,0],i.camera.viewMatrix);t.uniforms.add(new M("heightManifoldOrigin",(t,r)=>(e(U,t,r),i(W,r),n(W,W,U),a(F,W),F[3]=o(W),F)),new b("globalOrigin",e=>i(U,e)),new C("cosSphericalAngleThreshold",(e,i)=>1-Math.max(2,r(i.camera.eye,e.heightManifoldTarget)*i.camera.perRenderPixelRatio)/o(e.heightManifoldTarget))),t.code.add(L`float globeDistancePixels(float posInGlobalOriginLength) {
|
|
8
8
|
float dist = abs(posInGlobalOriginLength - heightManifoldOrigin.w);
|
|
9
9
|
float width = fwidth(dist);
|
|
10
10
|
dist /= min(width, maxPixelDistance);
|
|
@@ -18,22 +18,22 @@ float posInGlobalOriginLength = length(posInGlobalOrigin);
|
|
|
18
18
|
float sphericalDistance = globeDistancePixels(posInGlobalOriginLength);
|
|
19
19
|
float planarDistance = planeDistancePixels(heightPlane, pos);
|
|
20
20
|
return cosAngle < cosSphericalAngleThreshold ? sphericalDistance : planarDistance;
|
|
21
|
-
}`)}else t.code.add(
|
|
21
|
+
}`)}else t.code.add(L`float heightManifoldDistancePixels(vec4 heightPlane, vec3 pos) {
|
|
22
22
|
return planeDistancePixels(heightPlane, pos);
|
|
23
|
-
}`);if(
|
|
23
|
+
}`);if(g&&(t.uniforms.add(new C("maxPixelDistance",(e,i)=>2*i.camera.computeScreenPixelSizeAt(e.pointDistanceTarget))),t.code.add(L`float sphereDistancePixels(vec4 sphere, vec3 pos) {
|
|
24
24
|
float dist = distance(sphere.xyz, pos) - sphere.w;
|
|
25
25
|
float width = fwidth(dist);
|
|
26
26
|
dist /= min(width, maxPixelDistance);
|
|
27
27
|
return abs(dist);
|
|
28
|
-
}`)),
|
|
28
|
+
}`)),m&&t.uniforms.add(new S("perScreenPixelRatio",e=>e.camera.perScreenPixelRatio)).code.add(L`float lineDistancePixels(vec3 start, vec3 dir, float radius, vec3 pos) {
|
|
29
29
|
float dist = length(cross(dir, pos - start)) / (length(pos) * perScreenPixelRatio);
|
|
30
30
|
return abs(dist) - radius;
|
|
31
|
-
}`),(
|
|
31
|
+
}`),(d||m)&&t.code.add(L`bool pointIsWithinLine(vec3 pos, vec3 start, vec3 end) {
|
|
32
32
|
vec3 dir = end - start;
|
|
33
33
|
float t2 = dot(dir, pos - start);
|
|
34
34
|
float l2 = dot(dir, dir);
|
|
35
35
|
return t2 >= 0.0 && t2 <= l2;
|
|
36
|
-
}`),t.main.add(
|
|
36
|
+
}`),t.main.add(L`vec3 pos;
|
|
37
37
|
vec3 normal;
|
|
38
38
|
float angleCutoffAdjust;
|
|
39
39
|
float depthDiscontinuityAlpha;
|
|
@@ -41,22 +41,22 @@ if (!laserlineReconstructFromDepth(pos, normal, angleCutoffAdjust, depthDisconti
|
|
|
41
41
|
fragColor = vec4(0.0);
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
vec4 color = vec4(0.0);`),
|
|
44
|
+
vec4 color = vec4(0.0);`),f){t.uniforms.add(new P("angleCutoff",e=>V(e)),new M("heightPlane",(e,i)=>E(e.heightManifoldTarget,e.renderCoordsHelper.worldUpAtPosition(e.heightManifoldTarget,U),i.camera.viewMatrix)));const e=h?L`normalize(globalOrigin - pos)`:L`heightPlane.xyz`;t.main.add(L`
|
|
45
45
|
vec2 angleCutoffAdjusted = angleCutoff - angleCutoffAdjust;
|
|
46
46
|
// Fade out laserlines on flat surfaces
|
|
47
|
-
float heightManifoldAlpha = 1.0 - smoothstep(angleCutoffAdjusted.x, angleCutoffAdjusted.y, abs(dot(normal, ${
|
|
47
|
+
float heightManifoldAlpha = 1.0 - smoothstep(angleCutoffAdjusted.x, angleCutoffAdjusted.y, abs(dot(normal, ${e})));
|
|
48
48
|
vec4 heightManifoldColor = laserlineProfile(heightManifoldDistancePixels(heightPlane, pos));
|
|
49
|
-
color = max(color, heightManifoldColor * heightManifoldAlpha);`)}return
|
|
49
|
+
color = max(color, heightManifoldColor * heightManifoldAlpha);`)}return g&&(t.uniforms.add(new P("angleCutoff",e=>V(e)),new M("pointDistanceSphere",(e,i)=>O(e,i))),t.main.add(L`float pointDistanceSphereDistance = sphereDistancePixels(pointDistanceSphere, pos);
|
|
50
50
|
vec4 pointDistanceSphereColor = laserlineProfile(pointDistanceSphereDistance);
|
|
51
51
|
float pointDistanceSphereAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, abs(dot(normal, normalize(pos - pointDistanceSphere.xyz))));
|
|
52
|
-
color = max(color, pointDistanceSphereColor * pointDistanceSphereAlpha);`)),
|
|
52
|
+
color = max(color, pointDistanceSphereColor * pointDistanceSphereAlpha);`)),d&&(t.uniforms.add(new P("angleCutoff",e=>V(e)),new M("lineVerticalPlane",(e,i)=>z(e,i)),new D("lineVerticalStart",(e,i)=>I(e,i)),new D("lineVerticalEnd",(e,i)=>T(e,i))),t.main.add(L`if (pointIsWithinLine(pos, lineVerticalStart, lineVerticalEnd)) {
|
|
53
53
|
float lineVerticalDistance = planeDistancePixels(lineVerticalPlane, pos);
|
|
54
54
|
vec4 lineVerticalColor = laserlineProfile(lineVerticalDistance);
|
|
55
55
|
float lineVerticalAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, abs(dot(normal, lineVerticalPlane.xyz)));
|
|
56
56
|
color = max(color, lineVerticalColor * lineVerticalAlpha);
|
|
57
|
-
}`)),
|
|
57
|
+
}`)),m&&(t.uniforms.add(new P("angleCutoff",e=>V(e)),new D("intersectsLineStart",(e,i)=>l(U,e.lineStartWorld,i.camera.viewMatrix)),new D("intersectsLineEnd",(e,i)=>l(U,e.lineEndWorld,i.camera.viewMatrix)),new D("intersectsLineDirection",(e,i)=>(s(F,e.intersectsLineSegment.vector),F[3]=0,a(U,p(F,F,i.camera.viewMatrix)))),new C("intersectsLineRadius",e=>e.intersectsLineRadius)),t.main.add(L`if (pointIsWithinLine(pos, intersectsLineStart, intersectsLineEnd)) {
|
|
58
58
|
float intersectsLineDistance = lineDistancePixels(intersectsLineStart, intersectsLineDirection, intersectsLineRadius, pos);
|
|
59
59
|
vec4 intersectsLineColor = laserlineProfile(intersectsLineDistance);
|
|
60
60
|
float intersectsLineAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, 1.0 - abs(dot(normal, intersectsLineDirection)));
|
|
61
61
|
color = max(color, intersectsLineColor * intersectsLineAlpha);
|
|
62
|
-
}`)),t.main.add(
|
|
62
|
+
}`)),t.main.add("fragColor = laserlineOutput(color * depthDiscontinuityAlpha);"),i.include(v,e),i}function V(t){return i(R,Math.cos(t.angleCutoff),Math.cos(Math.max(0,t.angleCutoff-e(2))))}function O(e,i){return l(B,e.pointDistanceOrigin,i.camera.viewMatrix),B[3]=r(e.pointDistanceOrigin,e.pointDistanceTarget),B}function z(e,i){const t=m(e.lineVerticalPlaneSegment,.5,U),n=e.renderCoordsHelper.worldUpAtPosition(t,G),o=a(W,e.lineVerticalPlaneSegment.vector),r=c(U,n,o);return a(r,r),E(e.lineVerticalPlaneSegment.origin,r,i.camera.viewMatrix)}function I(e,i){const t=s(U,e.lineVerticalPlaneSegment.origin);return e.renderCoordsHelper.setAltitude(t,0),l(t,t,i.camera.viewMatrix)}function T(e,i){const t=d(U,e.lineVerticalPlaneSegment.origin,e.lineVerticalPlaneSegment.vector);return e.renderCoordsHelper.setAltitude(t,0),l(t,t,i.camera.viewMatrix)}function E(e,i,t){return l(H,e,t),s(F,i),F[3]=0,p(F,F,t),h(H,F,_)}const R=t(),U=f(),F=g(),G=f(),W=f(),H=f(),_=u(),B=g(),N=Object.freeze(Object.defineProperty({__proto__:null,build:y,defaultAngleCutoff:j},Symbol.toStringTag,{value:"Module"}));export{N as L,y as b,j as d};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as o}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{Laserline as a}from"../views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js";import{
|
|
2
|
+
import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as o}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{Laserline as a}from"../views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js";import{blendEmission as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/blendEmission.glsl.js";import{Float2BindUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{FloatBindUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{If as l,glsl as c}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Matrix4PassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as v}from"../views/webgl/ShaderBuilder.js";function w(t){const r=new v;r.include(a,t);const{outputs:w,vertex:u,fragment:h,attributes:x,varyings:j}=r;w.add("fragColor","vec4",0),u.uniforms.add(new m("modelView",(t,{camera:o})=>e(f,o.viewMatrix,t.origin)),new p("proj",({camera:e})=>e.projectionMatrix),new d("glowWidth",(e,{camera:t})=>e.glowWidth*t.pixelRatio),new n("pixelToNDC",({camera:e})=>o(g,2/e.fullViewport[2],2/e.fullViewport[3]))),x.add("start","vec3"),x.add("end","vec3"),t.spherical&&(x.add("startUp","vec3"),x.add("endUp","vec3")),x.add("extrude","vec2"),j.add("uv","vec2"),j.add("vViewStart","vec3"),j.add("vViewEnd","vec3"),j.add("vViewSegmentNormal","vec3"),j.add("vViewStartNormal","vec3"),j.add("vViewEndNormal","vec3");const P=!t.spherical;return u.main.add(c`
|
|
3
3
|
vec3 pos = mix(start, end, extrude.x);
|
|
4
|
-
|
|
5
4
|
vec4 viewPos = modelView * vec4(pos, 1);
|
|
6
5
|
vec4 projPos = proj * viewPos;
|
|
7
6
|
vec2 ndcPos = projPos.xy / projPos.w;
|
|
8
7
|
|
|
9
8
|
// in planar we hardcode the up vectors to be Z-up */
|
|
10
|
-
${l(
|
|
11
|
-
${l(
|
|
9
|
+
${l(P,c`vec3 startUp = vec3(0, 0, 1);`)}
|
|
10
|
+
${l(P,c`vec3 endUp = vec3(0, 0, 1);`)}
|
|
12
11
|
|
|
13
12
|
// up vector corresponding to the location of the vertex, selecting either startUp or endUp */
|
|
14
13
|
vec3 up = extrude.y * mix(startUp, endUp, extrude.x);
|
|
15
14
|
vec3 viewUp = (modelView * vec4(up, 0)).xyz;
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
// Use the projection differential to avoid subtracting two nearly identical NDC positions.
|
|
17
|
+
vec4 projViewUp = proj * vec4(viewUp, 0);
|
|
18
|
+
vec2 projectedUp = projPos.w * projViewUp.xy - projPos.xy * projViewUp.w;
|
|
19
|
+
float projectedUpLengthSq = dot(projectedUp, projectedUp);
|
|
20
|
+
vec2 projUp = projectedUpLengthSq == 0.0 ? vec2(0.0, 1.0) : projectedUp * inversesqrt(projectedUpLengthSq);
|
|
19
21
|
|
|
20
22
|
// extrude ndcPos along projUp to the edge of the screen
|
|
21
23
|
vec2 lxy = abs(sign(projUp) - ndcPos);
|
|
@@ -25,7 +27,6 @@ import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create
|
|
|
25
27
|
vViewEnd = (modelView * vec4(end, 1)).xyz;
|
|
26
28
|
|
|
27
29
|
vec3 viewStartEndDir = vViewEnd - vViewStart;
|
|
28
|
-
|
|
29
30
|
vec3 viewStartUp = (modelView * vec4(startUp, 0)).xyz;
|
|
30
31
|
|
|
31
32
|
// the normal of the plane that aligns with the segment and the up vector
|
|
@@ -46,7 +47,7 @@ import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create
|
|
|
46
47
|
uv = ndcPos * 0.5 + 0.5;
|
|
47
48
|
|
|
48
49
|
gl_Position = vec4(ndcPos, 0, 1);
|
|
49
|
-
`),
|
|
50
|
+
`),h.uniforms.add(new s("perScreenPixelRatio",e=>e.camera.perScreenPixelRatio)),h.code.add(c`float planeDistance(vec3 planeNormal, vec3 planeOrigin, vec3 pos) {
|
|
50
51
|
return dot(planeNormal, pos - planeOrigin);
|
|
51
52
|
}
|
|
52
53
|
float segmentDistancePixels(vec3 segmentNormal, vec3 startNormal, vec3 endNormal, vec3 pos, vec3 start, vec3 end) {
|
|
@@ -58,7 +59,7 @@ float width = fwidth(distSegmentPlane);
|
|
|
58
59
|
float maxPixelDistance = length(pos) * perScreenPixelRatio * 2.0;
|
|
59
60
|
float pixelDist = dist / min(width, maxPixelDistance);
|
|
60
61
|
return abs(pixelDist);
|
|
61
|
-
}`),
|
|
62
|
+
}`),h.main.add(c`fragColor = vec4(0.0);
|
|
62
63
|
vec3 dEndStart = vViewEnd - vViewStart;
|
|
63
64
|
if (dot(dEndStart, dEndStart) < 1e-5) {
|
|
64
65
|
return;
|
|
@@ -80,4 +81,4 @@ vViewEnd
|
|
|
80
81
|
);
|
|
81
82
|
vec4 color = laserlineProfile(distance);
|
|
82
83
|
float alpha = (1.0 - smoothstep(0.995 - angleCutoffAdjust, 0.999 - angleCutoffAdjust, abs(dot(normal, vViewSegmentNormal))));
|
|
83
|
-
fragColor = laserlineOutput(color * alpha * depthDiscontinuityAlpha);`),r}const
|
|
84
|
+
fragColor = laserlineOutput(color * alpha * depthDiscontinuityAlpha);`),r.include(i,t),r}const g=r(),f=t(),u=Object.freeze(Object.defineProperty({__proto__:null,build:w},Symbol.toStringTag,{value:"Module"}));export{u as L,w as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{floor as e,set as t,sub as o,scale as
|
|
2
|
+
import{floor as e,set as t,sub as o,scale as a,normalize as i,dot as r,lerp as n}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as s,fromValues as d}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float3BindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as p,If as v}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as f}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{ShaderBuilder as u}from"../views/webgl/ShaderBuilder.js";function h(e){const t=new u,{attributes:o,outputs:a,vertex:i,varyings:r,fragment:n}=t;o.add("position","vec3"),o.add("instanceFeatureAttribute","float"),a.add("fragColor","vec4",0),i.uniforms.add(new c("cameraPosition",e=>e.camera.eye),new m("offset",(e,t)=>g(e,t)),new l("width",e=>e.width),new l("time",e=>e.time),new f("proj",e=>e.camera.projectionMatrix),new f("view",e=>e.camera.viewMatrix)),r.add("vUv","vec2"),i.code.add(p`vec3 hash31(float p){
|
|
3
3
|
vec3 p3 = fract(vec3(p) * vec3(0.1031, 0.1030, 0.0973));
|
|
4
4
|
p3 += dot(p3, p3.yzx + 33.33);
|
|
5
5
|
return fract((p3.xxy + p3.yzz) * p3.zyx);
|
|
@@ -12,7 +12,7 @@ return fract(p);
|
|
|
12
12
|
}
|
|
13
13
|
vec3 rotateVectorByQuaternion(vec3 v, vec4 q){
|
|
14
14
|
return 2.0 * cross(q.xyz, v * q.w + cross(q.xyz, v)) + v;
|
|
15
|
-
}`)
|
|
15
|
+
}`);const s=0===e.type;return i.main.add(p`
|
|
16
16
|
vUv = position.xz;
|
|
17
17
|
vec3 rand = hash31(instanceFeatureAttribute);
|
|
18
18
|
|
|
@@ -37,7 +37,7 @@ return 2.0 * cross(q.xyz, v * q.w + cross(q.xyz, v)) + v;
|
|
|
37
37
|
|
|
38
38
|
// Rain particles fall straight down and are randomly oriented
|
|
39
39
|
// Snow particles have random sinusoid trajectories and are rotated to face the camera
|
|
40
|
-
${
|
|
40
|
+
${s?p`
|
|
41
41
|
// Random rotation for particle
|
|
42
42
|
vec3 rotationAxis = up;
|
|
43
43
|
vec4 quat = vec4(rotationAxis * sin(angle), cos(angle));
|
|
@@ -61,9 +61,9 @@ return 2.0 * cross(q.xyz, v * q.w + cross(q.xyz, v)) + v;
|
|
|
61
61
|
vec4 pos = mat4(mat3(view)) * vec4((mod(width * animatedPos - offset, width) - 0.5 * width), 1.0);
|
|
62
62
|
gl_Position = proj * (0.5 * vec4(position.xzy, 0.0) + pos);
|
|
63
63
|
`}
|
|
64
|
-
`),
|
|
64
|
+
`),n.uniforms.add(new l("opacity",e=>e.opacity),new c("particleColor",t=>w(t,e))),n.main.add(p`
|
|
65
65
|
float d = length(vUv - vec2(0.5));
|
|
66
66
|
|
|
67
|
-
${
|
|
67
|
+
${v(s,"d = 0.35 * smoothstep(0.5, 0.0, d);","d = smoothstep(0.5, 0.1, d);")}
|
|
68
68
|
fragColor = opacity * vec4(particleColor * d, d);
|
|
69
|
-
`),t}function
|
|
69
|
+
`),e.hasEmissive&&(t.outputs.add("fragEmission","vec4",1),t.fragment.main.add("fragEmission = vec4(vec3(0.0), fragColor.a * 0.75);")),t}function g(i,r){const n=r.camera.eye,s=.5*i.width,d=1/i.width,c=e(y,t(y,(n[0]+s)*d,(n[1]+s)*d,(n[2]+s)*d));return o(c,n,a(c,c,i.width))}function w(e,{type:t}){const o=0===t?P:b,s=a(y,o,j),d=e.camera.eye;i(x,d);const c=Math.max(0,r(x,e.lighting.mainLight.direction));return n(s,s,o,c)}const y=s(),x=s(),b=d(1,1,1),P=d(.85,.85,.85),j=.7,z=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}));export{z as P,h as b};
|