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.

72 lines (68 loc) 2.76 kB
import { S as ShaderStore } from './index-MZPybX0H.esm.js'; import { c as clipPlaneFragmentDeclarationWGSL, a as clipPlaneFragmentWGSL } from './clipPlaneFragment-C6Z5D7El.esm.js'; import { l as logDepthDeclarationWGSL } from './logDepthDeclaration-BPJH8Xtb.esm.js'; import { f as fogFragmentDeclarationWGSL, a as fogFragmentWGSL } from './fogFragment-Lnu5KyrF.esm.js'; import { p as packingFunctionsWGSL } from './packingFunctions-CRspvE8r.esm.js'; import { l as logDepthFragmentWGSL } from './logDepthFragment-DD4DS4oL.esm.js'; // Do not edit. const name$1 = "gaussianSplattingFragmentDeclaration"; const shader$1 = `fn gaussianColor(inColor: vec4f,inPosition: vec2f)->vec4f {var A : f32=-dot(inPosition,inPosition);if (A>-4.0) {var B: f32=exp(A)*inColor.a; #include<logDepthFragment> var color: vec3f=inColor.rgb; #ifdef FOG #include<fogFragment> #endif return vec4f(color,B);} else {return vec4f(0.0);}} `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name$1]) { ShaderStore.IncludesShadersStoreWGSL[name$1] = shader$1; } /** @internal */ const gaussianSplattingFragmentDeclarationWGSL = { name: name$1, shader: shader$1 }; // Do not edit. const name = "gaussianSplattingPixelShader"; const shader = `#include<clipPlaneFragmentDeclaration> #include<logDepthDeclaration> #include<fogFragmentDeclaration> #ifdef GPUPICKER_PACK_DEPTH #include<packingFunctions> #endif varying vColor: vec4f;varying vPosition: vec2f; #define CUSTOM_FRAGMENT_DEFINITIONS #include<gaussianSplattingFragmentDeclaration> @fragment fn main(input: FragmentInputs)->FragmentOutputs { #define CUSTOM_FRAGMENT_MAIN_BEGIN #include<clipPlaneFragment> var finalColor: vec4f=gaussianColor(input.vColor,input.vPosition); #define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR #ifdef GPUPICKER_DEPTH fragmentOutputs.fragData0=finalColor; #ifdef GPUPICKER_PACK_DEPTH fragmentOutputs.fragData1=pack(fragmentInputs.position.z); #else fragmentOutputs.fragData1=vec4f(fragmentInputs.position.z,0.0,0.0,1.0); #endif #else fragmentOutputs.color=finalColor; #endif #define CUSTOM_FRAGMENT_MAIN_END } `; // Sideeffect if (!ShaderStore.ShadersStoreWGSL[name]) { ShaderStore.ShadersStoreWGSL[name] = shader; } const includes = [clipPlaneFragmentDeclarationWGSL, logDepthDeclarationWGSL, fogFragmentDeclarationWGSL, packingFunctionsWGSL, logDepthFragmentWGSL, fogFragmentWGSL, gaussianSplattingFragmentDeclarationWGSL, clipPlaneFragmentWGSL]; for (const inc of includes) { if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) { ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader; } } /** @internal */ const gaussianSplattingPixelShaderWGSL = { name, shader }; export { gaussianSplattingPixelShaderWGSL }; //# sourceMappingURL=gaussianSplatting.fragment-DYQeWUlb.esm.js.map