kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
159 lines (155 loc) • 24.9 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
exports.insertBefore = insertBefore;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _core = require("@deck.gl/core");
var _core2 = require("@luma.gl/core");
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _superPropGet(t, e, r, o) { var p = (0, _get2["default"])((0, _getPrototypeOf2["default"])(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
// @ts-nocheck This is a hack, don't check types
// import {console as Console} from 'global/window';
/**
* Inserts shader code before detected part.
* @param {string} vs Original shader code.
* @param {string} type Debug string.
* @param {string} insertBeforeText Text chunk to insert before.
* @param {string} textToInsert Text to insert.
* @returns Modified shader code.
*/
function insertBefore(vs, type, insertBeforeText, textToInsert) {
var at = vs.indexOf(insertBeforeText);
if (at < 0) {
// Console.error(`Cannot edit ${type} layer shader`);
return vs;
}
return vs.slice(0, at) + textToInsert + vs.slice(at);
}
var CustomShadowModule = _core.shadow ? _objectSpread({}, _core.shadow) : undefined;
/**
* Custom shadow module
* 1) Add u_outputUniformShadow uniform
* 2) always produce full shadow when the uniform is set to true.
*/
CustomShadowModule.fs = insertBefore(CustomShadowModule.fs, 'custom shadow #1', 'uniform vec4 shadow_uColor;', 'uniform bool u_outputUniformShadow;');
CustomShadowModule.fs = insertBefore(CustomShadowModule.fs, 'custom shadow #1', 'vec4 rgbaDepth = texture2D(shadowMap, position.xy);', 'if(u_outputUniformShadow) return 1.0;');
CustomShadowModule.getUniforms = function () {
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var u = _core.shadow.getUniforms(opts, context);
if (opts.outputUniformShadow !== undefined) {
u.u_outputUniformShadow = opts.outputUniformShadow;
}
return u;
};
/**
* Custom LightingEffect
* 1) adds CustomShadowModule
* 2) pass outputUniformShadow as module parameters
* 3) properly removes CustomShadowModule
*/
var CustomDeckLightingEffect = /*#__PURE__*/function (_LightingEffect) {
function CustomDeckLightingEffect(props) {
var _this;
(0, _classCallCheck2["default"])(this, CustomDeckLightingEffect);
_this = _callSuper(this, CustomDeckLightingEffect, [props]);
_this.useOutputUniformShadow = false;
return _this;
}
(0, _inherits2["default"])(CustomDeckLightingEffect, _LightingEffect);
return (0, _createClass2["default"])(CustomDeckLightingEffect, [{
key: "preRender",
value: function preRender(gl, _ref) {
var layers = _ref.layers,
layerFilter = _ref.layerFilter,
viewports = _ref.viewports,
onViewportActive = _ref.onViewportActive,
views = _ref.views;
if (!this.shadow) return;
// create light matrix every frame to make sure always updated from light source
this.shadowMatrices = this._calculateMatrices();
if (this.shadowPasses.length === 0) {
this._createShadowPasses(gl);
}
if (!this.programManager) {
this.programManager = _core2.ProgramManager.getDefaultProgramManager(gl);
if (CustomShadowModule) {
this.programManager.addDefaultModule(CustomShadowModule);
}
}
if (!this.dummyShadowMap) {
this.dummyShadowMap = new _core2.Texture2D(gl, {
width: 1,
height: 1
});
}
for (var i = 0; i < this.shadowPasses.length; i++) {
var shadowPass = this.shadowPasses[i];
shadowPass.render({
layers: layers,
layerFilter: layerFilter,
viewports: viewports,
onViewportActive: onViewportActive,
views: views,
moduleParameters: {
shadowLightId: i,
dummyShadowMap: this.dummyShadowMap,
shadowMatrices: this.shadowMatrices,
useOutputUniformShadow: false
}
});
}
}
}, {
key: "getModuleParameters",
value: function getModuleParameters(layer) {
var parameters = _superPropGet(CustomDeckLightingEffect, "getModuleParameters", this, 3)([layer]);
parameters.outputUniformShadow = this.outputUniformShadow;
return parameters;
}
}, {
key: "cleanup",
value: function cleanup() {
var _iterator = _createForOfIteratorHelper(this.shadowPasses),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var shadowPass = _step.value;
shadowPass["delete"]();
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
this.shadowPasses.length = 0;
this.shadowMaps.length = 0;
if (this.dummyShadowMap) {
this.dummyShadowMap["delete"]();
this.dummyShadowMap = null;
}
if (this.shadow && this.programManager) {
this.programManager.removeDefaultModule(CustomShadowModule);
this.programManager = null;
}
}
}]);
}(_core.LightingEffect);
var _default = exports["default"] = CustomDeckLightingEffect;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfY29yZSIsInJlcXVpcmUiLCJfY29yZTIiLCJfY3JlYXRlRm9yT2ZJdGVyYXRvckhlbHBlciIsInIiLCJlIiwidCIsIlN5bWJvbCIsIml0ZXJhdG9yIiwiQXJyYXkiLCJpc0FycmF5IiwiX3Vuc3VwcG9ydGVkSXRlcmFibGVUb0FycmF5IiwibGVuZ3RoIiwiX24iLCJGIiwicyIsIm4iLCJkb25lIiwidmFsdWUiLCJmIiwiVHlwZUVycm9yIiwibyIsImEiLCJ1IiwiY2FsbCIsIm5leHQiLCJfYXJyYXlMaWtlVG9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