Sha256: 4fca827fe83f59e8faaf5f4c4f8ba8dc8542b78210c4d837e5df92f9c3c1a96d

Contents?: true

Size: 1.48 KB

Versions: 4

Compression:

Stored size: 1.48 KB

Contents

(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;
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
opal-js_wrap-three-0.1.5 lib-opal/js_wrap/three/shaders/TechnicolorShader.js
opal-js_wrap-three-0.1.4 lib-opal/js_wrap/three/shaders/TechnicolorShader.js
opal-js_wrap-three-0.1.3 lib-opal/js_wrap/three/shaders/TechnicolorShader.js
opal-js_wrap-three-0.1.2 lib-opal/js_wrap/three/shaders/TechnicolorShader.js