playcanvas
Version:
PlayCanvas WebGL game engine
3 lines (2 loc) • 1.75 kB
TypeScript
declare const _default: "\n var sourceTexture: texture_2d<f32>;\n var sourceTextureSampler: sampler;\n uniform sourceInvResolution: vec2f;\n varying uv0: vec2f;\n\n @fragment\n fn fragmentMain(input: FragmentInput) -> FragmentOutput {\n var output: FragmentOutput;\n\n let x: f32 = uniform.sourceInvResolution.x;\n let y: f32 = uniform.sourceInvResolution.y;\n\n let a: vec3f = textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x - x, input.uv0.y + y)).rgb;\n let b: vec3f = textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x, input.uv0.y + y)).rgb;\n let c: vec3f = textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x + x, input.uv0.y + y)).rgb;\n\n let d: vec3f = textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x - x, input.uv0.y)).rgb;\n let e: vec3f = textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x, input.uv0.y)).rgb;\n let f: vec3f = textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x + x, input.uv0.y)).rgb;\n\n let g: vec3f = textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x - x, input.uv0.y - y)).rgb;\n let h: vec3f = textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x, input.uv0.y - y)).rgb;\n let i: vec3f = textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x + x, input.uv0.y - y)).rgb;\n\n var value: vec3f = e * 4.0;\n value = value + (b + d + f + h) * 2.0;\n value = value + (a + c + g + i);\n value = value * (1.0 / 16.0);\n\n output.color = vec4f(value, 1.0);\n return output;\n }\n";
export default _default;