UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

3 lines (2 loc) 648 B
declare const _default: "\n #ifdef FRINGING\n uniform fringingIntensity: f32;\n\n fn applyFringing(color: vec3f, uv: vec2f) -> vec3f {\n // offset depends on the direction from the center\n let centerDistance = uv - 0.5;\n let offset = uniform.fringingIntensity * centerDistance * centerDistance;\n\n var colorOut = color;\n colorOut.r = textureSample(sceneTexture, sceneTextureSampler, uv - offset).r;\n colorOut.b = textureSample(sceneTexture, sceneTextureSampler, uv + offset).b;\n return colorOut;\n }\n #endif\n"; export default _default;