@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
36 lines • 1.39 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../../Engines/shaderStore.js";
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;
}
/** @internal */
export const oitFragment = { name, shader };
//# sourceMappingURL=oitFragment.js.map