UNPKG

@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.

73 lines (69 loc) 2.54 kB
import { S as ShaderStore } from './index-MZPybX0H.esm.js'; import { c as clipPlaneFragmentDeclaration, a as clipPlaneFragment } from './clipPlaneFragment-CKB1su_H.esm.js'; import { l as logDepthDeclaration } from './logDepthDeclaration-BdXvBJD5.esm.js'; import { f as fogFragmentDeclaration, a as fogFragment } from './fogFragment-C3YQIhnt.esm.js'; import { p as packingFunctions } from './packingFunctions-BkM6Y7GP.esm.js'; import { l as logDepthFragment } from './logDepthFragment-4hdISSc_.esm.js'; // Do not edit. const name$1 = "gaussianSplattingFragmentDeclaration"; const shader$1 = `vec4 gaussianColor(vec4 inColor) {float A=-dot(vPosition,vPosition);if (A<-4.0) discard;float B=exp(A)*inColor.a; #include<logDepthFragment> vec3 color=inColor.rgb; #ifdef FOG #include<fogFragment> #endif return vec4(color,B);} `; // Sideeffect if (!ShaderStore.IncludesShadersStore[name$1]) { ShaderStore.IncludesShadersStore[name$1] = shader$1; } /** @internal */ const gaussianSplattingFragmentDeclaration = { name: name$1, shader: shader$1 }; // Do not edit. const name = "gaussianSplattingPixelShader"; const shader = `#include<clipPlaneFragmentDeclaration> #include<logDepthDeclaration> #include<fogFragmentDeclaration> #ifdef GPUPICKER_DEPTH layout(location=0) out highp vec4 glFragData[2]; #endif #ifdef GPUPICKER_PACK_DEPTH #include<packingFunctions> #endif varying vec4 vColor;varying vec2 vPosition; #define CUSTOM_FRAGMENT_DEFINITIONS #include<gaussianSplattingFragmentDeclaration> void main () { #define CUSTOM_FRAGMENT_MAIN_BEGIN #include<clipPlaneFragment> vec4 finalColor=gaussianColor(vColor); #define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR #ifdef GPUPICKER_DEPTH glFragData[0]=finalColor; #ifdef GPUPICKER_PACK_DEPTH glFragData[1]=pack(gl_FragCoord.z); #else glFragData[1]=vec4(gl_FragCoord.z,0.0,0.0,1.0); #endif #else gl_FragColor=finalColor; #endif #define CUSTOM_FRAGMENT_MAIN_END } `; // Sideeffect if (!ShaderStore.ShadersStore[name]) { ShaderStore.ShadersStore[name] = shader; } const includes = [clipPlaneFragmentDeclaration, logDepthDeclaration, fogFragmentDeclaration, packingFunctions, logDepthFragment, fogFragment, gaussianSplattingFragmentDeclaration, clipPlaneFragment]; for (const inc of includes) { if (!ShaderStore.IncludesShadersStore[inc.name]) { ShaderStore.IncludesShadersStore[inc.name] = inc.shader; } } /** @internal */ const gaussianSplattingPixelShader = { name, shader }; export { gaussianSplattingPixelShader }; //# sourceMappingURL=gaussianSplatting.fragment-Bj6vbSMr.esm.js.map