playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
3 lines (2 loc) • 563 B
TypeScript
declare const _default: "\nconst A: f32 = 0.15;\nconst B: f32 = 0.50;\nconst C: f32 = 0.10;\nconst D: f32 = 0.20;\nconst E: f32 = 0.02;\nconst F: f32 = 0.30;\nconst W: f32 = 11.2;\n\nfn uncharted2Tonemap(x: vec3f) -> vec3f {\n return ((x * (A * x + C * B) + D * E) / (x * (A * x + B) + D * F)) - vec3f(E / F);\n}\n\nfn toneMap(color: vec3f) -> vec3f {\n var c: vec3f = uncharted2Tonemap(color * getExposure());\n let whiteScale: vec3f = vec3f(1.0) / uncharted2Tonemap(vec3f(W, W, W));\n c *= whiteScale;\n return c;\n}\n";
export default _default;