Sha256: 22c171018aa142253d5a98af86bb21c02de98909835700479abcd2d0fab61e34

Contents?: true

Size: 1.42 KB

Versions: 4

Compression:

Stored size: 1.42 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.BlendShader = mod.exports;
  }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.BlendShader = void 0;

  /**
   * Blend two textures
   */
  var BlendShader = {
    uniforms: {
      'tDiffuse1': {
        value: null
      },
      'tDiffuse2': {
        value: null
      },
      'mixRatio': {
        value: 0.5
      },
      'opacity': {
        value: 1.0
      }
    },
    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 float opacity;\n\t\tuniform float mixRatio;\n\n\t\tuniform sampler2D tDiffuse1;\n\t\tuniform sampler2D tDiffuse2;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel1 = texture2D( tDiffuse1, vUv );\n\t\t\tvec4 texel2 = texture2D( tDiffuse2, vUv );\n\t\t\tgl_FragColor = opacity * mix( texel1, texel2, mixRatio );\n\n\t\t}"
  };
  _exports.BlendShader = BlendShader;
});

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/BlendShader.js
opal-js_wrap-three-0.1.4 lib-opal/js_wrap/three/shaders/BlendShader.js
opal-js_wrap-three-0.1.3 lib-opal/js_wrap/three/shaders/BlendShader.js
opal-js_wrap-three-0.1.2 lib-opal/js_wrap/three/shaders/BlendShader.js