PageSourceSearch

https://distygame.manus.space/assets/kernelBlur.fragment-CJCbIAND.js

js distygame.manus.space collected 2026-10-03 05:01:53 UTC 2,726 bytes, 60 lines download raw bytes

1import{S as e}from"./index-B2RPBpOK.js";import{k as c}from"./kernelBlurVaryingDeclaration-ClHXtBnl.js";const r="packingFunctions",l=`vec4 pack(float depth)
2{const vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}
3float unpack(vec4 color)
4{const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=l);const f={name:r,shader:l},n="kernelBlurFragment",s=`#ifdef DOF
5factor=sampleCoC(sampleCoord{X}); 
6computedWeight=KERNEL_WEIGHT{X}*factor;sumOfWeights+=computedWeight;
7#else
8computedWeight=KERNEL_WEIGHT{X};
9#endif
10#ifdef PACKEDFLOAT
11blend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight;
12#else
13blend+=texture2D(textureSampler,sampleCoord{X})*computedWeight;
14#endif
15`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=s);const u={name:n,shader:s},a="kernelBlurFragment2",d=`#ifdef DOF
16factor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});computedWeight=KERNEL_DEP_WEIGHT{X}*factor;sumOfWeights+=computedWeight;
17#else
18computedWeight=KERNEL_DEP_WEIGHT{X};
19#endif
20#ifdef PACKEDFLOAT
21blend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight;
22#else
23blend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight;
24#endif
25`;e.IncludesShadersStore[a]||(e.IncludesShadersStore[a]=d);const m={name:a,shader:d},o="kernelBlurPixelShader",i=`uniform sampler2D textureSampler;uniform vec2 delta;varying vec2 sampleCenter;
26#ifdef DOF
27uniform sampler2D circleOfConfusionSampler;float sampleCoC(in vec2 offset) {float coc=texture2D(circleOfConfusionSampler,offset).r;return coc; }
28#endif
29#include<kernelBlurVaryingDeclaration>[0..varyingCount]
30#ifdef PACKEDFLOAT
31#include<packingFunctions>
32#endif
33#define CUSTOM_FRAGMENT_DEFINITIONS
34void main(void)
35{float computedWeight=0.0;
36#ifdef PACKEDFLOAT
37float blend=0.;
38#else
39vec4 blend=vec4(0.);
40#endif
41#ifdef DOF
42float sumOfWeights=CENTER_WEIGHT; 
43float factor=0.0;
44#ifdef PACKEDFLOAT
45blend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT;
46#else
47blend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT;
48#endif
49#endif
50#include<kernelBlurFragment>[0..varyingCount]
51#include<kernelBlurFragment2>[0..depCount]
52#ifdef PACKEDFLOAT
53gl_FragColor=pack(blend);
54#else
55gl_FragColor=blend;
56#endif
57#ifdef DOF
58gl_FragColor/=sumOfWeights;
59#endif
60}`;e.ShadersStore[o]||(e.ShadersStore[o]=i);const p=[c,f,u,m];for(const t of p)e.IncludesShadersStore[t.name]||(e.IncludesShadersStore[t.name]=t.shader);const S={name:o,shader:i};export{S as kernelBlurPixelShader};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.