(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { factory(exports); } else { var mod = { exports: {} }; factory(mod.exports); global.TechnicolorShader = mod.exports; } })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.TechnicolorShader = void 0; /** * Technicolor Shader * Simulates the look of the two-strip technicolor process popular in early 20th century films. * More historical info here: http://www.widescreenmuseum.com/oldcolor/technicolor1.htm * Demo here: http://charliehoey.com/technicolor_shader/shader_test.html */ var TechnicolorShader = { uniforms: { 'tDiffuse': { value: null } }, vertexShader: /* glsl */ "\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}", fragmentShader: /* glsl */ "\n\n\t\tuniform sampler2D tDiffuse;\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );\n\t\t\tvec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);\n\n\t\t\tgl_FragColor = newTex;\n\n\t\t}" }; _exports.TechnicolorShader = TechnicolorShader; });