@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.
81 lines (76 loc) • 2.8 kB
JavaScript
import { S as ShaderStore } from './index-FzOfPXLV.esm.js';
// Do not edit.
const name$3 = "prePassDeclaration";
const shader$3 = `
varying vPosition : vec3f;
varying vViewPos: vec3f;
varying vNormViewDepth: f32;
varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name$3]) {
ShaderStore.IncludesShadersStoreWGSL[name$3] = shader$3;
}
// Do not edit.
const name$2 = "oitDeclaration";
const shader$2 = `
var oitDepthSamplerSampler: sampler;var oitDepthSampler: texture_2d<f32>;var oitFrontColorSamplerSampler: sampler;var oitFrontColorSampler: texture_2d<f32>;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name$2]) {
ShaderStore.IncludesShadersStoreWGSL[name$2] = shader$2;
}
// Do not edit.
const name$1 = "depthPrePass";
const shader$1 = `
fragmentOutputs.color= vec4f(0.,0.,0.,1.0);return fragmentOutputs;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name$1]) {
ShaderStore.IncludesShadersStoreWGSL[name$1] = shader$1;
}
// Do not edit.
const name = "oitFragment";
const shader = `
var fragDepth: f32=fragmentInputs.position.z;
var halfFloat: u32=pack2x16float( vec2f(fragDepth));var full: vec2f=unpack2x16float(halfFloat);fragDepth=full.x;
var fragCoord: vec2i=vec2i(fragmentInputs.position.xy);var lastDepth: vec2f=textureLoad(oitDepthSampler,fragCoord,0).rg;var lastFrontColor: vec4f=textureLoad(oitFrontColorSampler,fragCoord,0);fragmentOutputs.depth=vec2f(-MAX_DEPTH);fragmentOutputs.frontColor=lastFrontColor;fragmentOutputs.backColor= vec4f(0.0);
var furthestDepth: f32=-lastDepth.x;var nearestDepth: f32=lastDepth.y;
var nearestDepth: f32=-lastDepth.x;var furthestDepth: f32=lastDepth.y;
var alphaMultiplier: f32=1.0-lastFrontColor.a;
if (fragDepth>nearestDepth || fragDepth<furthestDepth) {
if (fragDepth<nearestDepth || fragDepth>furthestDepth) {
return fragmentOutputs;}
if (fragDepth<nearestDepth && fragDepth>furthestDepth) {
if (fragDepth>nearestDepth && fragDepth<furthestDepth) {
fragmentOutputs.depth=vec2f(-fragDepth,fragDepth);return fragmentOutputs;}
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name]) {
ShaderStore.IncludesShadersStoreWGSL[name] = shader;
}
//# sourceMappingURL=oitFragment-DBax_G7o.esm.js.map