@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.
114 lines (107 loc) • 3.47 kB
JavaScript
import { S as ShaderStore } from './index-FzOfPXLV.esm.js';
// Do not edit.
const name$5 = "prePassDeclaration";
const shader$5 = `
layout(location=0) out highp vec4 glFragData[{X}];highp vec4 gl_FragColor;
varying highp vec3 vPosition;
varying highp vec3 vViewPos;
varying highp float vNormViewDepth;
varying highp vec4 vCurrentPosition;varying highp vec4 vPreviousPosition;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name$5]) {
ShaderStore.IncludesShadersStore[name$5] = shader$5;
}
// Do not edit.
const name$4 = "oitDeclaration";
const shader$4 = `
layout(location=0) out vec2 depth;
layout(location=1) out vec4 frontColor;layout(location=2) out vec4 backColor;
highp vec4 gl_FragColor;uniform sampler2D oitDepthSampler;uniform sampler2D oitFrontColorSampler;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name$4]) {
ShaderStore.IncludesShadersStore[name$4] = shader$4;
}
// Do not edit.
const name$3 = "decalFragmentDeclaration";
const shader$3 = `
uniform vec4 vDecalInfos;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name$3]) {
ShaderStore.IncludesShadersStore[name$3] = shader$3;
}
// Do not edit.
const name$2 = "decalFragment";
const shader$2 = `
decalColor.rgb=toLinearSpace(decalColor.rgb);
decalColor.a*=decalColor.a;
surfaceAlbedo.rgb=mix(surfaceAlbedo.rgb,decalColor.rgb,decalColor.a);
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name$2]) {
ShaderStore.IncludesShadersStore[name$2] = shader$2;
}
// Do not edit.
const name$1 = "depthPrePass";
const shader$1 = `
gl_FragColor=vec4(0.,0.,0.,1.0);return;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name$1]) {
ShaderStore.IncludesShadersStore[name$1] = shader$1;
}
// Do not edit.
const name = "oitFragment";
const shader = `
float fragDepth=gl_FragCoord.z;
uint halfFloat=packHalf2x16(vec2(fragDepth));vec2 full=unpackHalf2x16(halfFloat);fragDepth=full.x;
ivec2 fragCoord=ivec2(gl_FragCoord.xy);vec2 lastDepth=texelFetch(oitDepthSampler,fragCoord,0).rg;vec4 lastFrontColor=texelFetch(oitFrontColorSampler,fragCoord,0);depth.rg=vec2(-MAX_DEPTH);frontColor=lastFrontColor;backColor=vec4(0.0);
float furthestDepth=-lastDepth.x;float nearestDepth=lastDepth.y;
float nearestDepth=-lastDepth.x;float furthestDepth=lastDepth.y;
float alphaMultiplier=1.0-lastFrontColor.a;
if (fragDepth>nearestDepth || fragDepth<furthestDepth) {
if (fragDepth<nearestDepth || fragDepth>furthestDepth) {
return;}
if (fragDepth<nearestDepth && fragDepth>furthestDepth) {
if (fragDepth>nearestDepth && fragDepth<furthestDepth) {
depth.rg=vec2(-fragDepth,fragDepth);return;}
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name]) {
ShaderStore.IncludesShadersStore[name] = shader;
}
//# sourceMappingURL=oitFragment-BdhuC7k_.esm.js.map