{"version":3,"file":"GammaCorrectionShader.cjs","sources":["../../src/shaders/GammaCorrectionShader.ts"],"sourcesContent":["/**\n * Gamma Correction Shader\n * http://en.wikipedia.org/wiki/gamma_correction\n */\n\nimport type { IUniform, Texture } from 'three'\nimport type { IShader } from './types'\n\nexport type GammaCorrectionShaderUniforms = {\n tDiffuse: IUniform\n}\n\nexport interface IGammaCorrectionShader extends IShader {}\n\nexport const GammaCorrectionShader: IGammaCorrectionShader = {\n uniforms: {\n tDiffuse: { value: null },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n uniform sampler2D tDiffuse;\n\n varying vec2 vUv;\n\n void main() {\n\n \tvec4 tex = texture2D( tDiffuse, vUv );\n\n \t#ifdef LinearTosRGB\n \t\tgl_FragColor = LinearTosRGB( tex );\n \t#else\n \t\tgl_FragColor = sRGBTransferOETF( tex );\n \t#endif\n\n }\n `,\n}\n"],"names":[],"mappings":";;AAcO,MAAM,wBAAgD;AAAA,EAC3D,UAAU;AAAA,IACR,UAAU,EAAE,OAAO,KAAK;AAAA,EAC1B;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiB7B;;"}