123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- import {
- a,
- a3 as a2,
- e,
- e2,
- f as f2,
- i,
- n as n2,
- n2 as n3,
- o,
- o2,
- o3,
- t2 as t
- } from "./chunk-FQZKJNXZ.js";
- import {
- f,
- n
- } from "./chunk-K7B6OWCU.js";
- import {
- r as r2
- } from "./chunk-E3G7BRZB.js";
- import {
- x
- } from "./chunk-DW42UVIT.js";
- import {
- r
- } from "./chunk-YXWMMD76.js";
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js
- var o4 = class extends i {
- constructor(r3, o5) {
- super(r3, "vec2", a.Draw, (e3, s, t2, i2) => e3.setUniform2fv(r3, o5(s, t2, i2)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js
- var f3 = class extends i {
- constructor(r3, e3) {
- super(r3, "sampler2D", a.Draw, (o5, s, t2) => o5.bindTexture(r3, e3(s, t2)));
- }
- };
- function u(s, c2, p = e2.None) {
- const u3 = [new f3(s, c2)];
- if (p & e2.Size) {
- const i2 = s + t;
- u3.push(new o4(i2, (s2, t2) => {
- const i3 = c2(s2, t2);
- return r(i3) ? r2(a3, i3.descriptor.width, i3.descriptor.height) : f;
- }));
- }
- if (p & e2.InvSize) {
- const t2 = s + n3;
- u3.push(new o4(t2, (s2, t3) => {
- const i2 = c2(s2, t3);
- return r(i2) ? r2(a3, 1 / i2.descriptor.width, 1 / i2.descriptor.height) : f;
- }));
- }
- return u3;
- }
- var a3 = n();
- // node_modules/@arcgis/core/chunks/SSAOBlur.glsl.js
- var f4 = 4;
- function c() {
- const c2 = new o2(), u3 = c2.fragment;
- c2.include(o);
- const m = (f4 + 1) / 2, p = 1 / (2 * m * m);
- return u3.include(a2), u3.uniforms.add([new f2("depthMap", (e3) => e3.depthTexture), new f3("tex", (e3) => e3.colorTexture), new o4("blurSize", (e3) => e3.blurSize), new o3("projScale", (r3, o5) => {
- const t2 = x(o5.camera.eye, o5.camera.center);
- return t2 > 5e4 ? Math.max(0, r3.projScale - (t2 - 5e4)) : r3.projScale;
- }), new e("nearFar", (e3, r3) => r3.camera.nearFar)]), u3.code.add(n2`
- void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
- float c = texture2D(tex, uv).r;
- float d = linearDepthFromTexture(depthMap, uv, nearFar);
- float ddiff = d - center_d;
- float w = exp(-r * r * ${n2.float(p)} - ddiff * ddiff * sharpness);
- wTotal += w;
- bTotal += w * c;
- }
- `), u3.code.add(n2`
- void main(void) {
- float b = 0.0;
- float w_total = 0.0;
- float center_d = linearDepthFromTexture(depthMap, uv, nearFar);
- float sharpness = -0.05 * projScale / center_d;
- for (int r = -${n2.int(f4)}; r <= ${n2.int(f4)}; ++r) {
- float rf = float(r);
- vec2 uvOffset = uv + rf * blurSize;
- blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
- }
- gl_FragColor = vec4(b / w_total);
- }
- `), c2;
- }
- var u2 = Object.freeze(Object.defineProperty({ __proto__: null, build: c }, Symbol.toStringTag, { value: "Module" }));
- export {
- u,
- c,
- u2
- };
- //# sourceMappingURL=chunk-2UEXES4O.js.map
|