@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
89 lines (84 loc) • 2.58 kB
JavaScript
import { S as ShaderStore } from './index-FzOfPXLV.esm.js';
import './kernelBlurVaryingDeclaration-Xi4ZGvSi.esm.js';
import './packingFunctions-C2Dsz6z6.esm.js';
// Do not edit.
const name$2 = "kernelBlurFragment";
const shader$2 = `
factor=sampleCoC(sampleCoord{X});
computedWeight=KERNEL_WEIGHT{X}*factor;sumOfWeights+=computedWeight;
computedWeight=KERNEL_WEIGHT{X};
blend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight;
blend+=texture2D(textureSampler,sampleCoord{X})*computedWeight;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name$2]) {
ShaderStore.IncludesShadersStore[name$2] = shader$2;
}
// Do not edit.
const name$1 = "kernelBlurFragment2";
const shader$1 = `
factor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});computedWeight=KERNEL_DEP_WEIGHT{X}*factor;sumOfWeights+=computedWeight;
computedWeight=KERNEL_DEP_WEIGHT{X};
blend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight;
blend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name$1]) {
ShaderStore.IncludesShadersStore[name$1] = shader$1;
}
// Do not edit.
const name = "kernelBlurPixelShader";
const shader = `uniform sampler2D textureSampler;uniform vec2 delta;varying vec2 sampleCenter;
uniform sampler2D circleOfConfusionSampler;float sampleCoC(in vec2 offset) {float coc=texture2D(circleOfConfusionSampler,offset).r;return coc; }
void main(void)
{float computedWeight=0.0;
float blend=0.;
vec4 blend=vec4(0.);
float sumOfWeights=CENTER_WEIGHT;
float factor=0.0;
blend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT;
blend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT;
gl_FragColor=pack(blend);
gl_FragColor=blend;
gl_FragColor/=sumOfWeights;
}`;
// Sideeffect
if (!ShaderStore.ShadersStore[name]) {
ShaderStore.ShadersStore[name] = shader;
}
/** @internal */
const kernelBlurPixelShader = { name, shader };
export { kernelBlurPixelShader };
//# sourceMappingURL=kernelBlur.fragment-BmXuxF74.esm.js.map