@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.
27 lines • 989 B
JavaScript
// Do not edit.
import { ShaderStore } from "../Engines/shaderStore.js";
const name = "circleOfConfusionPixelShader";
const shader = `uniform sampler2D depthSampler;varying vec2 vUV;
uniform vec2 cameraMinMaxZ;
uniform float focusDistance;uniform float cocPrecalculation;
void main(void)
{float depth=texture2D(depthSampler,vUV).r;
float pixelDistance=depth*1000.0;
float pixelDistance=(cameraMinMaxZ.x+cameraMinMaxZ.y*depth)*1000.0;
float coc=abs(cocPrecalculation*((focusDistance-pixelDistance)/pixelDistance));coc=clamp(coc,0.0,1.0);gl_FragColor=vec4(coc,coc,coc,1.0);}
`;
// Sideeffect
if (!ShaderStore.ShadersStore[name]) {
ShaderStore.ShadersStore[name] = shader;
}
/** @internal */
export const circleOfConfusionPixelShader = { name, shader };
//# sourceMappingURL=circleOfConfusion.fragment.js.map