123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- import {
- a as a2,
- a2 as a3,
- a3 as a4,
- b,
- c,
- d,
- d2,
- d4 as d3,
- e2 as e4,
- e3 as e5,
- e4 as e6,
- e6 as e7,
- e8,
- h,
- h3 as h2,
- h4 as h3,
- i,
- i3 as i2,
- i4 as i3,
- n as n3,
- n2 as n4,
- n3 as n5,
- n4 as n6,
- o as o3,
- o2 as o4,
- o4 as o6,
- p,
- p2,
- r2 as r3,
- s,
- s2,
- t,
- u2 as u3,
- u3 as u4,
- v,
- v2,
- x
- } from "./chunk-5242SYQJ.js";
- import {
- o2 as o5
- } from "./chunk-LDMWL65U.js";
- import {
- u as u2
- } from "./chunk-2UEXES4O.js";
- import {
- e as e2
- } from "./chunk-UUVY36LI.js";
- import {
- a,
- e2 as e3,
- f,
- n as n2,
- o2,
- o3 as o7,
- r as r2,
- u
- } from "./chunk-FQZKJNXZ.js";
- import {
- O
- } from "./chunk-RUM3DXFX.js";
- import {
- o
- } from "./chunk-44FMXGSC.js";
- import {
- e
- } from "./chunk-IQBIGNPU.js";
- import {
- n
- } from "./chunk-O6VYMEIX.js";
- import {
- r
- } from "./chunk-YXWMMD76.js";
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js
- function e9(e10, o8) {
- const n8 = e10.fragment;
- switch (n8.code.add(n2`struct ShadingNormalParameters {
- vec3 normalView;
- vec3 viewDirection;
- } shadingParams;`), o8.doubleSidedMode) {
- case i4.None:
- n8.code.add(n2`vec3 shadingNormal(ShadingNormalParameters params) {
- return normalize(params.normalView);
- }`);
- break;
- case i4.View:
- n8.code.add(n2`vec3 shadingNormal(ShadingNormalParameters params) {
- return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView);
- }`);
- break;
- case i4.WindingOrder:
- n8.code.add(n2`vec3 shadingNormal(ShadingNormalParameters params) {
- return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView);
- }`);
- break;
- default:
- n(o8.doubleSidedMode);
- case i4.COUNT:
- }
- }
- var i4;
- !function(a5) {
- a5[a5.None = 0] = "None", a5[a5.View = 1] = "View", a5[a5.WindingOrder = 2] = "WindingOrder", a5[a5.COUNT = 3] = "COUNT";
- }(i4 || (i4 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js
- function c2(c3, u5) {
- const l = c3.fragment;
- if (u5.hasVertexTangents ? (c3.attributes.add(O.TANGENT, "vec4"), c3.varyings.add("vTangent", "vec4"), u5.doubleSidedMode === i4.WindingOrder ? l.code.add(n2`mat3 computeTangentSpace(vec3 normal) {
- float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
- vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
- vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
- return mat3(tangent, bitangent, normal);
- }`) : l.code.add(n2`mat3 computeTangentSpace(vec3 normal) {
- float tangentHeadedness = vTangent.w;
- vec3 tangent = normalize(vTangent.xyz);
- vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
- return mat3(tangent, bitangent, normal);
- }`)) : (c3.extensions.add("GL_OES_standard_derivatives"), l.code.add(n2`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {
- vec3 Q1 = dFdx(pos);
- vec3 Q2 = dFdy(pos);
- vec2 stx = dFdx(st);
- vec2 sty = dFdy(st);
- float det = stx.t * sty.s - sty.t * stx.s;
- vec3 T = stx.t * Q2 - sty.t * Q1;
- T = T - normal * dot(normal, T);
- T *= inversesqrt(max(dot(T,T), 1.e-10));
- vec3 B = sign(det) * cross(normal, T);
- return mat3(T, B, normal);
- }`)), u5.textureCoordinateType !== d.None) {
- c3.include(a2, u5);
- const e10 = u5.supportsTextureAtlas ? u5.hasWebGL2Context ? e3.None : e3.Size : e3.None;
- l.uniforms.add(u5.pbrTextureBindType === a.Pass ? u("normalTexture", (e11) => e11.textureNormal, e10) : u2("normalTexture", (e11) => e11.textureNormal, e10)), l.code.add(n2`
- vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
- vtc.uv = uv;
- ${u5.supportsTextureAtlas ? n2`vtc.size = ${r2(u5, "normalTexture")};` : ""}
- vec3 rawNormal = textureLookup(normalTexture, vtc).rgb * 2.0 - 1.0;
- return tangentSpace * rawNormal;
- }
- `);
- }
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js
- function s3(s4) {
- s4.vertex.uniforms.add(new e5("colorTextureTransformMatrix", (o8) => r(o8.colorTextureTransformMatrix) ? o8.colorTextureTransformMatrix : e())), s4.varyings.add("colorUV", "vec2"), s4.vertex.code.add(n2`void forwardColorUV(){
- colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
- }`);
- }
- function i5(s4) {
- s4.vertex.uniforms.add(new e5("normalTextureTransformMatrix", (o8) => r(o8.normalTextureTransformMatrix) ? o8.normalTextureTransformMatrix : e())), s4.varyings.add("normalUV", "vec2"), s4.vertex.code.add(n2`void forwardNormalUV(){
- normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
- }`);
- }
- function t2(s4) {
- s4.vertex.uniforms.add(new e5("emissiveTextureTransformMatrix", (o8) => r(o8.emissiveTextureTransformMatrix) ? o8.emissiveTextureTransformMatrix : e())), s4.varyings.add("emissiveUV", "vec2"), s4.vertex.code.add(n2`void forwardEmissiveUV(){
- emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
- }`);
- }
- function n7(s4) {
- s4.vertex.uniforms.add(new e5("occlusionTextureTransformMatrix", (o8) => r(o8.occlusionTextureTransformMatrix) ? o8.occlusionTextureTransformMatrix : e())), s4.varyings.add("occlusionUV", "vec2"), s4.vertex.code.add(n2`void forwardOcclusionUV(){
- occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
- }`);
- }
- function x2(s4) {
- s4.vertex.uniforms.add(new e5("metallicRoughnessTextureTransformMatrix", (o8) => r(o8.metallicRoughnessTextureTransformMatrix) ? o8.metallicRoughnessTextureTransformMatrix : e())), s4.varyings.add("metallicRoughnessUV", "vec2"), s4.vertex.code.add(n2`void forwardMetallicRoughnessUV(){
- metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
- }`);
- }
- // node_modules/@arcgis/core/chunks/DefaultMaterial.glsl.js
- function Q(Q2) {
- const X2 = new o2(), { vertex: Y, fragment: Z, varyings: ee } = X2;
- return v(Y, Q2), X2.include(o6), ee.add("vpos", "vec3"), X2.include(s, Q2), X2.include(p, Q2), X2.include(a3, Q2), Q2.hasColorTextureTransform && X2.include(s3), Q2.output !== h.Color && Q2.output !== h.Alpha || (Q2.hasNormalTextureTransform && X2.include(i5), Q2.hasEmissionTextureTransform && X2.include(t2), Q2.hasOcclusionTextureTransform && X2.include(n7), Q2.hasMetallicRoughnessTextureTransform && X2.include(x2), c(Y, Q2), X2.include(o3, Q2), X2.include(r3, Q2), Q2.normalType === i.Attribute && Q2.offsetBackfaces && X2.include(e7), X2.include(c2, Q2), X2.include(n3, Q2), Q2.instancedColor && X2.attributes.add(O.INSTANCECOLOR, "vec4"), ee.add("localvpos", "vec3"), X2.include(o4, Q2), X2.include(d3, Q2), X2.include(i2, Q2), X2.include(e8, Q2), Y.uniforms.add(new e2("externalColor", (e10) => e10.externalColor)), ee.add("vcolorExt", "vec4"), Q2.hasMultipassTerrain && ee.add("depth", "float"), Q2.hasModelTransformation && Y.uniforms.add(new e6("model", (o8) => r(o8.modelTransformation) ? o8.modelTransformation : o)), Y.code.add(n2`
- void main(void) {
- forwardNormalizedVertexColor();
- vcolorExt = externalColor;
- ${Q2.instancedColor ? "vcolorExt *= instanceColor;" : ""}
- vcolorExt *= vvColor();
- vcolorExt *= getSymbolColor();
- forwardColorMixMode();
- if (vcolorExt.a < ${n2.float(t)}) {
- gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
- } else {
- vpos = calculateVPos();
- localvpos = vpos - view[3].xyz;
- vpos = subtractOrigin(vpos);
- ${Q2.normalType === i.Attribute ? n2`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));` : ""}
- vpos = addVerticalOffset(vpos, localOrigin);
- ${Q2.hasVertexTangents ? "vTangent = dpTransformVertexTangent(tangent);" : ""}
- gl_Position = transformPosition(proj, view, ${Q2.hasModelTransformation ? "model," : ""} vpos);
- ${Q2.normalType === i.Attribute && Q2.offsetBackfaces ? "gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);" : ""}
- }
- ${Q2.hasMultipassTerrain ? "depth = (view * vec4(vpos, 1.0)).z;" : ""}
- forwardLinearDepth();
- forwardTextureCoordinates();
- ${Q2.hasColorTextureTransform ? n2`forwardColorUV();` : ""}
- ${Q2.hasNormalTextureTransform ? n2`forwardNormalUV();` : ""}
- ${Q2.hasEmissionTextureTransform ? n2`forwardEmissiveUV();` : ""}
- ${Q2.hasOcclusionTextureTransform ? n2`forwardOcclusionUV();` : ""}
- ${Q2.hasMetallicRoughnessTextureTransform ? n2`forwardMetallicRoughnessUV();` : ""}
- }
- `)), Q2.output === h.Alpha && (X2.include(u3, Q2), X2.include(s2, Q2), X2.include(n6, Q2), Z.uniforms.add([new o7("opacity", (e10) => e10.opacity), new o7("layerOpacity", (e10) => e10.layerOpacity)]), Q2.hasColorTexture && Z.uniforms.add(new f("tex", (e10) => e10.texture)), Z.include(i3), Z.code.add(n2`
- void main() {
- discardBySlice(vpos);
- ${Q2.hasMultipassTerrain ? "terrainDepthTest(gl_FragCoord, depth);" : ""}
- ${Q2.hasColorTexture ? n2`
- vec4 texColor = texture2D(tex, ${Q2.hasColorTextureTransform ? n2`colorUV` : n2`vuv0`});
- ${Q2.textureAlphaPremultiplied ? "texColor.rgb /= texColor.a;" : ""}
- discardOrAdjustAlpha(texColor);` : n2`vec4 texColor = vec4(1.0);`}
- ${Q2.hasVertexColors ? n2`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));` : n2`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
- gl_FragColor = vec4(opacity_);
- }
- `)), Q2.output === h.Color && (X2.include(u3, Q2), X2.include(p2, Q2), X2.include(n4, Q2), X2.include(s2, Q2), X2.include(Q2.instancedDoublePrecision ? h3 : v2, Q2), X2.include(n6, Q2), c(Z, Q2), Z.uniforms.add([Y.uniforms.get("localOrigin"), new e4("ambient", (e10) => e10.ambient), new e4("diffuse", (e10) => e10.diffuse), new o7("opacity", (e10) => e10.opacity), new o7("layerOpacity", (e10) => e10.layerOpacity)]), Q2.hasColorTexture && Z.uniforms.add(new f("tex", (e10) => e10.texture)), X2.include(x, Q2), X2.include(n5, Q2), Z.include(i3), X2.include(e9, Q2), h2(Z), u4(Z), a4(Z), Z.code.add(n2`
- void main() {
- discardBySlice(vpos);
- ${Q2.hasMultipassTerrain ? "terrainDepthTest(gl_FragCoord, depth);" : ""}
- ${Q2.hasColorTexture ? n2`
- vec4 texColor = texture2D(tex, ${Q2.hasColorTextureTransform ? n2`colorUV` : n2`vuv0`});
- ${Q2.textureAlphaPremultiplied ? "texColor.rgb /= texColor.a;" : ""}
- discardOrAdjustAlpha(texColor);` : n2`vec4 texColor = vec4(1.0);`}
- shadingParams.viewDirection = normalize(vpos - cameraPosition);
- ${Q2.normalType === i.ScreenDerivative ? n2`
- vec3 normal = screenDerivativeNormal(localvpos);` : n2`
- shadingParams.normalView = vNormalWorld;
- vec3 normal = shadingNormal(shadingParams);`}
- ${Q2.pbrMode === d2.Normal ? "applyPBRFactors();" : ""}
- float ssao = evaluateAmbientOcclusionInverse();
- ssao *= getBakedOcclusion();
- vec3 posWorld = vpos + localOrigin;
- float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
- float shadow = ${Q2.receiveShadows ? "readShadowMap(vpos, linearDepth)" : Q2.spherical ? "lightingGlobalFactor * (1.0 - additionalAmbientScale)" : "0.0"};
- vec3 matColor = max(ambient, diffuse);
- ${Q2.hasVertexColors ? n2`
- vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
- float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));` : n2`
- vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
- float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
- ${Q2.hasNormalTexture ? n2`
- mat3 tangentSpace = ${Q2.hasVertexTangents ? "computeTangentSpace(normal);" : "computeTangentSpace(normal, vpos, vuv0);"}
- vec3 shadingNormal = computeTextureNormal(tangentSpace, vuv0);` : n2`vec3 shadingNormal = normal;`}
- vec3 normalGround = ${Q2.spherical ? n2`normalize(posWorld);` : n2`vec3(0.0, 0.0, 1.0);`}
- ${Q2.snowCover ? n2`
- float snow = smoothstep(0.5, 0.55, dot(normal, normalGround));
- albedo = mix(albedo, vec3(1), snow);
- shadingNormal = mix(shadingNormal, normal, snow);
- ssao = mix(ssao, 1.0, snow);` : ""}
- vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
- ${Q2.pbrMode === d2.Normal || Q2.pbrMode === d2.Schematic ? n2`
- float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
- ${Q2.snowCover ? n2`
- mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
- emission = mix(emission, vec3(0.0), snow);` : ""}
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);` : n2`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
- gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
- ${Q2.transparencyPassType === o5.Color ? n2`gl_FragColor = premultiplyAlpha(gl_FragColor);` : ""}
- }
- `)), X2.include(b, Q2), X2;
- }
- var X = Object.freeze(Object.defineProperty({ __proto__: null, build: Q }, Symbol.toStringTag, { value: "Module" }));
- export {
- i4 as i,
- Q,
- X
- };
- //# sourceMappingURL=chunk-WDB6D6R7.js.map
|