9d1253e7cceddfd9861e51d235b3bbfc09d27e34725b3751f614f8e82b7d4075.json 2.8 KB

1
  1. {"ast":null,"code":"// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore.js\";\nconst name = \"iblShadowsIcdfyPixelShader\";\nconst shader = `precision highp sampler2D;\n#define PI 3.1415927\nvarying vec2 vUV;uniform sampler2D cdfy;float fetchCDF(int y,int invocationId) {return texelFetch(cdfy,ivec2(invocationId,y),0).x;}\nfloat bisect(int size,float targetValue,int invocationId)\n{int a=0,b=size-1;while (b-a>1) {int c=a+b>>1;if (fetchCDF(c,invocationId)<targetValue)\na=c;else\nb=c;}\nreturn mix(float(a),float(b),(targetValue-fetchCDF(a,invocationId))/(fetchCDF(b,invocationId)-fetchCDF(a,invocationId)))/float(size-1);}\nvoid main(void) {ivec2 cdfSize=textureSize(cdfy,0);int cdfHeight=cdfSize.y;ivec2 currentPixel=ivec2(gl_FragCoord.xy);if (currentPixel.y==0)\n{gl_FragColor=vec4(0.0);}\nelse if (currentPixel.y==cdfHeight-2) {gl_FragColor=vec4(1.0);} else {float targetValue=fetchCDF(cdfHeight-1,currentPixel.x)*vUV.y;gl_FragColor=vec4(vec3(bisect(cdfHeight,targetValue,currentPixel.x)),1.0);}}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblShadowsIcdfyPixelShader = {\n name,\n shader\n};","map":{"version":3,"names":["ShaderStore","name","shader","ShadersStore","iblShadowsIcdfyPixelShader"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Shaders/iblShadowsIcdfy.fragment.js"],"sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore.js\";\nconst name = \"iblShadowsIcdfyPixelShader\";\nconst shader = `precision highp sampler2D;\n#define PI 3.1415927\nvarying vec2 vUV;uniform sampler2D cdfy;float fetchCDF(int y,int invocationId) {return texelFetch(cdfy,ivec2(invocationId,y),0).x;}\nfloat bisect(int size,float targetValue,int invocationId)\n{int a=0,b=size-1;while (b-a>1) {int c=a+b>>1;if (fetchCDF(c,invocationId)<targetValue)\na=c;else\nb=c;}\nreturn mix(float(a),float(b),(targetValue-fetchCDF(a,invocationId))/(fetchCDF(b,invocationId)-fetchCDF(a,invocationId)))/float(size-1);}\nvoid main(void) {ivec2 cdfSize=textureSize(cdfy,0);int cdfHeight=cdfSize.y;ivec2 currentPixel=ivec2(gl_FragCoord.xy);if (currentPixel.y==0)\n{gl_FragColor=vec4(0.0);}\nelse if (currentPixel.y==cdfHeight-2) {gl_FragColor=vec4(1.0);} else {float targetValue=fetchCDF(cdfHeight-1,currentPixel.x)*vUV.y;gl_FragColor=vec4(vec3(bisect(cdfHeight,targetValue,currentPixel.x)),1.0);}}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblShadowsIcdfyPixelShader = { name, shader };\n"],"mappings":"AAAA;AACA,SAASA,WAAW,QAAQ,2BAA2B;AACvD,MAAMC,IAAI,GAAG,4BAA4B;AACzC,MAAMC,MAAM,GAAG;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gNAAgN;AAChN;AACAF,WAAW,CAACG,YAAY,CAACF,IAAI,CAAC,GAAGC,MAAM;AACvC;AACA,OAAO,MAAME,0BAA0B,GAAG;EAAEH,IAAI;EAAEC;AAAO,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}