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.

3 lines (2 loc) 2.81 kB
import{S as e}from"./index-BPURObVq.esm.min.js";import{m as n}from"./mrtFragmentDeclaration-DvFQ6mGX.esm.min.js";const a="iblVoxelGridPixelShader",r="#extension GL_EXT_draw_buffers : require\nprecision highp float;varying vec3 vNormalizedPosition;\n#include<mrtFragmentDeclaration>[MAX_DRAW_BUFFERS]\nuniform float nearPlane;uniform float farPlane;uniform float stepSize;void main(void) {vec3 normPos=vNormalizedPosition.xyz;if (normPos.z<nearPlane || normPos.z>farPlane) {discard;}\nglFragData[0]=normPos.z<nearPlane+stepSize ? vec4(1.0) : vec4(0.0);\n#if MAX_DRAW_BUFFERS>1\nglFragData[1]=normPos.z>=nearPlane+stepSize && normPos.z<nearPlane+2.0*stepSize ? vec4(1.0) : vec4(0.0);glFragData[2]=normPos.z>=nearPlane+2.0*stepSize && normPos.z<nearPlane+3.0*stepSize ? vec4(1.0) : vec4(0.0);glFragData[3]=normPos.z>=nearPlane+3.0*stepSize && normPos.z<nearPlane+4.0*stepSize ? vec4(1.0) : vec4(0.0);\n#endif\n#if MAX_DRAW_BUFFERS>4\nglFragData[4]=normPos.z>=nearPlane+4.0*stepSize && normPos.z<nearPlane+5.0*stepSize ? vec4(1.0) : vec4(0.0);glFragData[5]=normPos.z>=nearPlane+5.0*stepSize && normPos.z<nearPlane+6.0*stepSize ? vec4(1.0) : vec4(0.0);glFragData[6]=normPos.z>=nearPlane+6.0*stepSize && normPos.z<nearPlane+7.0*stepSize ? vec4(1.0) : vec4(0.0);glFragData[7]=normPos.z>=nearPlane+7.0*stepSize && normPos.z<nearPlane+8.0*stepSize ? vec4(1.0) : vec4(0.0);\n#endif\n#if MAX_DRAW_BUFFERS>8\nglFragData[8]=normPos.z>=nearPlane+8.0*stepSize && normPos.z<nearPlane+9.0*stepSize ? vec4(1.0) : vec4(0.0);\n#endif\n#if MAX_DRAW_BUFFERS>9\nglFragData[9]=normPos.z>=nearPlane+9.0*stepSize && normPos.z<nearPlane+10.0*stepSize ? vec4(1.0) : vec4(0.0);\n#endif\n#if MAX_DRAW_BUFFERS>10\nglFragData[10]=normPos.z>=nearPlane+10.0*stepSize && normPos.z<nearPlane+11.0*stepSize ? vec4(1.0) : vec4(0.0);\n#endif\n#if MAX_DRAW_BUFFERS>11\nglFragData[11]=normPos.z>=nearPlane+11.0*stepSize && normPos.z<nearPlane+12.0*stepSize ? vec4(1.0) : vec4(0.0);\n#endif\n#if MAX_DRAW_BUFFERS>12\nglFragData[12]=normPos.z>=nearPlane+12.0*stepSize && normPos.z<nearPlane+13.0*stepSize ? vec4(1.0) : vec4(0.0);\n#endif\n#if MAX_DRAW_BUFFERS>13\nglFragData[13]=normPos.z>=nearPlane+13.0*stepSize && normPos.z<nearPlane+14.0*stepSize ? vec4(1.0) : vec4(0.0);\n#endif\n#if MAX_DRAW_BUFFERS>14\nglFragData[14]=normPos.z>=nearPlane+14.0*stepSize && normPos.z<nearPlane+15.0*stepSize ? vec4(1.0) : vec4(0.0);\n#endif\n#if MAX_DRAW_BUFFERS>15\nglFragData[15]=normPos.z>=nearPlane+15.0*stepSize && normPos.z<nearPlane+16.0*stepSize ? vec4(1.0) : vec4(0.0);\n#endif\n}";e.ShadersStore[a]||(e.ShadersStore[a]=r);const o=[n];for(const n of o)e.IncludesShadersStore[n.name]||(e.IncludesShadersStore[n.name]=n.shader);const s={name:a,shader:r};export{s as iblVoxelGridPixelShader}; //# sourceMappingURL=iblVoxelGrid.fragment-ruoC9is5.esm.min.js.map