Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@luma.gl/core

Package Overview
Dependencies
Maintainers
7
Versions
246
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luma.gl/core - npm Package Compare versions

Comparing version 7.1.0-alpha.4 to 7.1.0-alpha.5

LICENSE

11

dist/es6/geometries/cone-geometry.js

@@ -7,8 +7,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";

let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _props$id = props.id,
id = _props$id === void 0 ? uid('cone-geometry') : _props$id,
_props$radius = props.radius,
radius = _props$radius === void 0 ? 1 : _props$radius,
_props$cap = props.cap,
cap = _props$cap === void 0 ? true : _props$cap;
const {
id = uid('cone-geometry'),
radius = 1,
cap = true
} = props;
super(_objectSpread({}, props, {

@@ -15,0 +14,0 @@ id,

@@ -25,4 +25,5 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";

let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _props$id = props.id,
id = _props$id === void 0 ? uid('cube-geometry') : _props$id;
const {
id = uid('cube-geometry')
} = props;
super(_objectSpread({}, props, {

@@ -29,0 +30,0 @@ id,

@@ -7,6 +7,6 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";

let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _props$id = props.id,
id = _props$id === void 0 ? uid('cylinder-geometry') : _props$id,
_props$radius = props.radius,
radius = _props$radius === void 0 ? 1 : _props$radius;
const {
id = uid('cylinder-geometry'),
radius = 1
} = props;
super(_objectSpread({}, props, {

@@ -13,0 +13,0 @@ id,

@@ -10,9 +10,9 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";

let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _props$id = props.id,
id = _props$id === void 0 ? uid('ico-sphere-geometry') : _props$id;
const _tesselateIcosaHedron = tesselateIcosaHedron(props),
indices = _tesselateIcosaHedron.indices,
attributes = _tesselateIcosaHedron.attributes;
const {
id = uid('ico-sphere-geometry')
} = props;
const {
indices,
attributes
} = tesselateIcosaHedron(props);
super(_objectSpread({}, props, {

@@ -29,4 +29,5 @@ id,

let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _props$iterations = props.iterations,
iterations = _props$iterations === void 0 ? 0 : _props$iterations;
const {
iterations = 0
} = props;
const PI = Math.PI;

@@ -33,0 +34,0 @@ const PI2 = PI * 2;

@@ -8,9 +8,9 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";

let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _props$id = props.id,
id = _props$id === void 0 ? uid('plane-geometry') : _props$id;
const _tesselatePlane = tesselatePlane(props),
indices = _tesselatePlane.indices,
attributes = _tesselatePlane.attributes;
const {
id = uid('plane-geometry')
} = props;
const {
indices,
attributes
} = tesselatePlane(props);
super(_objectSpread({}, props, {

@@ -26,10 +26,8 @@ id,

function tesselatePlane(props) {
const _props$type = props.type,
type = _props$type === void 0 ? 'x,y' : _props$type,
_props$offset = props.offset,
offset = _props$offset === void 0 ? 0 : _props$offset,
_props$flipCull = props.flipCull,
flipCull = _props$flipCull === void 0 ? false : _props$flipCull,
_props$unpack = props.unpack,
unpack = _props$unpack === void 0 ? false : _props$unpack;
const {
type = 'x,y',
offset = 0,
flipCull = false,
unpack = false
} = props;
const coords = type.split(',');

@@ -36,0 +34,0 @@ let c1len = props["".concat(coords[0], "len")];

@@ -7,9 +7,9 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";

let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _props$id = props.id,
id = _props$id === void 0 ? uid('sphere-geometry') : _props$id;
const _tesselateSphere = tesselateSphere(props),
indices = _tesselateSphere.indices,
attributes = _tesselateSphere.attributes;
const {
id = uid('sphere-geometry')
} = props;
const {
indices,
attributes
} = tesselateSphere(props);
super(_objectSpread({}, props, {

@@ -25,8 +25,9 @@ id,

function tesselateSphere(props) {
const _props$nlat = props.nlat,
nlat = _props$nlat === void 0 ? 10 : _props$nlat,
_props$nlong = props.nlong,
nlong = _props$nlong === void 0 ? 10 : _props$nlong;
let _props$radius = props.radius,
radius = _props$radius === void 0 ? 1 : _props$radius;
const {
nlat = 10,
nlong = 10
} = props;
let {
radius = 1
} = props;
const startLat = 0;

@@ -33,0 +34,0 @@ const endLat = Math.PI;

@@ -12,9 +12,9 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";

let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _props$id = props.id,
id = _props$id === void 0 ? uid('truncated-code-geometry') : _props$id;
const _tesselateTruncatedCo = tesselateTruncatedCone(props),
indices = _tesselateTruncatedCo.indices,
attributes = _tesselateTruncatedCo.attributes;
const {
id = uid('truncated-code-geometry')
} = props;
const {
indices,
attributes
} = tesselateTruncatedCone(props);
super(_objectSpread({}, props, {

@@ -30,18 +30,12 @@ id,

function tesselateTruncatedCone(props) {
const _props$bottomRadius = props.bottomRadius,
bottomRadius = _props$bottomRadius === void 0 ? 0 : _props$bottomRadius,
_props$topRadius = props.topRadius,
topRadius = _props$topRadius === void 0 ? 0 : _props$topRadius,
_props$height = props.height,
height = _props$height === void 0 ? 1 : _props$height,
_props$nradial = props.nradial,
nradial = _props$nradial === void 0 ? 10 : _props$nradial,
_props$nvertical = props.nvertical,
nvertical = _props$nvertical === void 0 ? 10 : _props$nvertical,
_props$verticalAxis = props.verticalAxis,
verticalAxis = _props$verticalAxis === void 0 ? 'y' : _props$verticalAxis,
_props$topCap = props.topCap,
topCap = _props$topCap === void 0 ? false : _props$topCap,
_props$bottomCap = props.bottomCap,
bottomCap = _props$bottomCap === void 0 ? false : _props$bottomCap;
const {
bottomRadius = 0,
topRadius = 0,
height = 1,
nradial = 10,
nvertical = 10,
verticalAxis = 'y',
topCap = false,
bottomCap = false
} = props;
const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);

@@ -48,0 +42,0 @@ const numVertices = (nradial + 1) * (nvertical + 1 + extra);

export function unpackIndexedGeometry(geometry) {
const indices = geometry.indices,
attributes = geometry.attributes;
const {
indices,
attributes
} = geometry;

@@ -9,5 +11,7 @@ if (!indices) {

const POSITION = attributes.POSITION,
NORMAL = attributes.NORMAL,
TEXCOORD_0 = attributes.TEXCOORD_0;
const {
POSITION,
NORMAL,
TEXCOORD_0
} = attributes;
const unpackedPositions = new Float32Array(indices.length * 3);

@@ -14,0 +18,0 @@ const unpackedNormals = new Float32Array(indices.length * 3);

@@ -19,13 +19,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";

let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _props$id = props.id,
id = _props$id === void 0 ? uid('geometry') : _props$id,
_props$drawMode = props.drawMode,
drawMode = _props$drawMode === void 0 ? DRAW_MODE.TRIANGLES : _props$drawMode,
mode = props.mode,
_props$attributes = props.attributes,
attributes = _props$attributes === void 0 ? {} : _props$attributes,
_props$indices = props.indices,
indices = _props$indices === void 0 ? null : _props$indices,
_props$vertexCount = props.vertexCount,
vertexCount = _props$vertexCount === void 0 ? null : _props$vertexCount;
const {
id = uid('geometry'),
drawMode = DRAW_MODE.TRIANGLES,
mode,
attributes = {},
indices = null,
vertexCount = null
} = props;
this.id = id;

@@ -99,5 +96,7 @@ this.drawMode = drawMode | 0 || mode | 0;

const attribute = attributes[attributeName];
const value = attribute.value,
size = attribute.size,
constant = attribute.constant;
const {
value,
size,
constant
} = attribute;

@@ -104,0 +103,0 @@ if (!constant && value && size >= 1) {

@@ -80,10 +80,8 @@ import { getPageLoadPromise, getCanvas } from '@luma.gl/webgl';

let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
const _opts$onInitialize = opts.onInitialize,
onInitialize = _opts$onInitialize === void 0 ? () => {} : _opts$onInitialize,
_opts$onFinalize = opts.onFinalize,
onFinalize = _opts$onFinalize === void 0 ? () => {} : _opts$onFinalize,
_opts$useDevicePixels = opts.useDevicePixels,
useDevicePixels = _opts$useDevicePixels === void 0 ? true : _opts$useDevicePixels,
_opts$autoResizeDrawi = opts.autoResizeDrawingBuffer,
autoResizeDrawingBuffer = _opts$autoResizeDrawi === void 0 ? true : _opts$autoResizeDrawi;
const {
onInitialize = () => {},
onFinalize = () => {},
useDevicePixels = true,
autoResizeDrawingBuffer = true
} = opts;
this.props = {

@@ -90,0 +88,0 @@ onInitialize,

@@ -8,28 +8,19 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";

let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _props$onCreateContex = props.onCreateContext,
onCreateContext = _props$onCreateContex === void 0 ? opts => createGLContext(opts) : _props$onCreateContex,
_props$onAddHTML = props.onAddHTML,
onAddHTML = _props$onAddHTML === void 0 ? null : _props$onAddHTML,
_props$onInitialize = props.onInitialize,
onInitialize = _props$onInitialize === void 0 ? () => {} : _props$onInitialize,
_props$onRender = props.onRender,
onRender = _props$onRender === void 0 ? () => {} : _props$onRender,
_props$onFinalize = props.onFinalize,
onFinalize = _props$onFinalize === void 0 ? () => {} : _props$onFinalize,
_props$gl = props.gl,
gl = _props$gl === void 0 ? null : _props$gl,
_props$glOptions = props.glOptions,
glOptions = _props$glOptions === void 0 ? {} : _props$glOptions,
_props$debug = props.debug,
debug = _props$debug === void 0 ? false : _props$debug,
_props$createFramebuf = props.createFramebuffer,
createFramebuffer = _props$createFramebuf === void 0 ? false : _props$createFramebuf,
_props$autoResizeView = props.autoResizeViewport,
autoResizeViewport = _props$autoResizeView === void 0 ? true : _props$autoResizeView,
_props$autoResizeDraw = props.autoResizeDrawingBuffer,
autoResizeDrawingBuffer = _props$autoResizeDraw === void 0 ? true : _props$autoResizeDraw,
_props$stats = props.stats,
stats = _props$stats === void 0 ? lumaStats.get("animation-loop-".concat(statIdCounter++)) : _props$stats;
let _props$useDevicePixel = props.useDevicePixels,
useDevicePixels = _props$useDevicePixel === void 0 ? true : _props$useDevicePixel;
const {
onCreateContext = opts => createGLContext(opts),
onAddHTML = null,
onInitialize = () => {},
onRender = () => {},
onFinalize = () => {},
gl = null,
glOptions = {},
debug = false,
createFramebuffer = false,
autoResizeViewport = true,
autoResizeDrawingBuffer = true,
stats = lumaStats.get("animation-loop-".concat(statIdCounter++))
} = props;
let {
useDevicePixels = true
} = props;

@@ -327,6 +318,7 @@ if ('useDevicePixelRatio' in props) {

_updateCallbackData() {
const _this$_getSizeAndAspe = this._getSizeAndAspect(),
width = _this$_getSizeAndAspe.width,
height = _this$_getSizeAndAspe.height,
aspect = _this$_getSizeAndAspe.aspect;
const {
width,
height,
aspect
} = this._getSizeAndAspect();

@@ -406,5 +398,6 @@ if (width !== this.animationProps.width || height !== this.animationProps.height) {

let aspect = 1;
const _this$gl$canvas = this.gl.canvas,
clientWidth = _this$gl$canvas.clientWidth,
clientHeight = _this$gl$canvas.clientHeight;
const {
clientWidth,
clientHeight
} = this.gl.canvas;

@@ -411,0 +404,0 @@ if (clientWidth > 0 && clientHeight > 0) {

@@ -13,4 +13,5 @@ import { isWebGL, Query, Program, VertexArray, clear } from '@luma.gl/webgl';

assert(isWebGL(gl));
const _props$id = props.id,
id = _props$id === void 0 ? uid('base-model') : _props$id;
const {
id = uid('base-model')
} = props;
this.id = id;

@@ -109,16 +110,12 @@ this.gl = gl;

let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _opts$moduleSettings = opts.moduleSettings,
moduleSettings = _opts$moduleSettings === void 0 ? null : _opts$moduleSettings,
framebuffer = opts.framebuffer,
_opts$uniforms = opts.uniforms,
uniforms = _opts$uniforms === void 0 ? {} : _opts$uniforms,
_opts$attributes = opts.attributes,
attributes = _opts$attributes === void 0 ? {} : _opts$attributes,
_opts$transformFeedba = opts.transformFeedback,
transformFeedback = _opts$transformFeedba === void 0 ? this.transformFeedback : _opts$transformFeedba,
_opts$parameters = opts.parameters,
parameters = _opts$parameters === void 0 ? {} : _opts$parameters,
_opts$vertexArray = opts.vertexArray,
vertexArray = _opts$vertexArray === void 0 ? this.vertexArray : _opts$vertexArray,
animationProps = opts.animationProps;
const {
moduleSettings = null,
framebuffer,
uniforms = {},
attributes = {},
transformFeedback = this.transformFeedback,
parameters = {},
vertexArray = this.vertexArray,
animationProps
} = opts;
addModel(this);

@@ -139,15 +136,18 @@ this.setAttributes(attributes);

const isIndexed = drawParams.isIndexed,
indexType = drawParams.indexType,
indexOffset = drawParams.indexOffset;
const isInstanced = this.isInstanced,
instanceCount = this.instanceCount;
const {
isIndexed,
indexType,
indexOffset
} = drawParams;
const {
isInstanced,
instanceCount
} = this;
const noop = () => {};
const _this$props = this.props,
_this$props$onBeforeR = _this$props.onBeforeRender,
onBeforeRender = _this$props$onBeforeR === void 0 ? noop : _this$props$onBeforeR,
_this$props$onAfterRe = _this$props.onAfterRender,
onAfterRender = _this$props$onAfterRe === void 0 ? noop : _this$props$onAfterRe;
const {
onBeforeRender = noop,
onAfterRender = noop
} = this.props;
onBeforeRender();

@@ -184,8 +184,10 @@

let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _opts$discard = opts.discard,
discard = _opts$discard === void 0 ? true : _opts$discard,
feedbackBuffers = opts.feedbackBuffers,
_opts$unbindModels = opts.unbindModels,
unbindModels = _opts$unbindModels === void 0 ? [] : _opts$unbindModels;
let parameters = opts.parameters;
const {
discard = true,
feedbackBuffers,
unbindModels = []
} = opts;
let {
parameters
} = opts;

@@ -244,20 +246,13 @@ if (feedbackBuffers) {

_createProgram(_ref) {
let _ref$vs = _ref.vs,
vs = _ref$vs === void 0 ? null : _ref$vs,
_ref$fs = _ref.fs,
fs = _ref$fs === void 0 ? null : _ref$fs,
_ref$modules = _ref.modules,
modules = _ref$modules === void 0 ? null : _ref$modules,
_ref$defines = _ref.defines,
defines = _ref$defines === void 0 ? {} : _ref$defines,
_ref$inject = _ref.inject,
inject = _ref$inject === void 0 ? {} : _ref$inject,
_ref$shaderCache = _ref.shaderCache,
shaderCache = _ref$shaderCache === void 0 ? null : _ref$shaderCache,
_ref$varyings = _ref.varyings,
varyings = _ref$varyings === void 0 ? null : _ref$varyings,
_ref$bufferMode = _ref.bufferMode,
bufferMode = _ref$bufferMode === void 0 ? 35981 : _ref$bufferMode,
_ref$program = _ref.program,
program = _ref$program === void 0 ? null : _ref$program;
let {
vs = null,
fs = null,
modules = null,
defines = {},
inject = {},
shaderCache = null,
varyings = null,
bufferMode = 35981,
program = null
} = _ref;

@@ -279,4 +274,6 @@ this.getModuleUniforms = x => {};

});
vs = assembleResult.vs;
fs = assembleResult.fs;
({
vs,
fs
} = assembleResult);

@@ -421,13 +418,15 @@ if (shaderCache) {

});
const _getDebugTableForUnif = getDebugTableForUniforms({
const {
table: uniformTable,
unusedTable,
unusedCount
} = getDebugTableForUniforms({
header: "".concat(this.id, " uniforms"),
program: this.program,
uniforms: Object.assign({}, this.program.uniforms, uniforms)
}),
uniformTable = _getDebugTableForUnif.table,
unusedTable = _getDebugTableForUnif.unusedTable,
unusedCount = _getDebugTableForUnif.unusedCount;
const _getDebugTableForUnif2 = getDebugTableForUniforms({
});
const {
table: missingTable,
count: missingCount
} = getDebugTableForUniforms({
header: "".concat(this.id, " uniforms"),

@@ -437,5 +436,3 @@ program: this.program,

undefinedOnly: true
}),
missingTable = _getDebugTableForUnif2.table,
missingCount = _getDebugTableForUnif2.count;
});

@@ -442,0 +439,0 @@ if (missingCount > 0) {

@@ -43,6 +43,5 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";

function mapAttributeName(name, options) {
const _ref = options || {},
_ref$attributeMap = _ref.attributeMap,
attributeMap = _ref$attributeMap === void 0 ? GLTF_TO_LUMA_ATTRIBUTE_MAP : _ref$attributeMap;
const {
attributeMap = GLTF_TO_LUMA_ATTRIBUTE_MAP
} = options || {};
return attributeMap && attributeMap[name] || name;

@@ -49,0 +48,0 @@ }

@@ -10,4 +10,5 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";

constructor(gl, props) {
const _props$id = props.id,
id = _props$id === void 0 ? uid('model') : _props$id;
const {
id = uid('model')
} = props;
super(gl, _objectSpread({}, props, {

@@ -117,8 +118,10 @@ id

let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _options$discard = options.discard,
discard = _options$discard === void 0 ? true : _options$discard,
feedbackBuffers = options.feedbackBuffers,
_options$unbindModels = options.unbindModels,
unbindModels = _options$unbindModels === void 0 ? [] : _options$unbindModels;
let parameters = options.parameters;
const {
discard = true,
feedbackBuffers,
unbindModels = []
} = options;
let {
parameters
} = options;

@@ -201,3 +204,5 @@ if (feedbackBuffers) {

const gl = this.program.gl;
const {
gl
} = this.program;
this.transformFeedback = this.transformFeedback || new TransformFeedback(gl, {

@@ -204,0 +209,0 @@ program: this.program

@@ -1,2 +0,1 @@

import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
const NULL_PICKING_COLOR = new Uint8Array([0, 0, 0]);

@@ -7,7 +6,3 @@ export function encodePickingColor(i) {

export function decodePickingColor(color) {
const _color = _slicedToArray(color, 3),
i1 = _color[0],
i2 = _color[1],
i3 = _color[2];
const [i1, i2, i3] = color;
const index = i1 + i2 * 256 + i3 * 65536 - 1;

@@ -14,0 +9,0 @@ return index;

@@ -5,7 +5,6 @@ import { VertexShader, FragmentShader, Program } from '@luma.gl/webgl';

constructor() {
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
gl = _ref.gl,
_ref$_cachePrograms = _ref._cachePrograms,
_cachePrograms = _ref$_cachePrograms === void 0 ? false : _ref$_cachePrograms;
let {
gl,
_cachePrograms = false
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
assert(gl);

@@ -84,4 +83,6 @@ this.gl = gl;

_createNewProgram(gl, opts) {
const vs = opts.vs,
fs = opts.fs;
const {
vs,
fs
} = opts;
const vertexShader = this.getVertexShader(gl, vs);

@@ -88,0 +89,0 @@ const fragmentShader = this.getFragmentShader(gl, fs);

@@ -7,6 +7,8 @@ import { assert } from '../utils';

export function updateForTextures(_ref) {
let vs = _ref.vs,
sourceTextureMap = _ref.sourceTextureMap,
targetTextureVarying = _ref.targetTextureVarying,
targetTexture = _ref.targetTexture;
let {
vs,
sourceTextureMap,
targetTextureVarying,
targetTexture
} = _ref;
const texAttributeNames = Object.keys(sourceTextureMap);

@@ -27,4 +29,6 @@ let sourceCount = texAttributeNames.length;

if (updated) {
const updatedLine = updated.updatedLine,
inject = updated.inject;
const {
updatedLine,
inject
} = updated;
updateVsLines[index] = updatedLine;

@@ -65,5 +69,7 @@ finalInject = combineInjects([finalInject, inject]);

export function getSizeUniforms(_ref2) {
let sourceTextureMap = _ref2.sourceTextureMap,
targetTextureVarying = _ref2.targetTextureVarying,
targetTexture = _ref2.targetTexture;
let {
sourceTextureMap,
targetTextureVarying,
targetTexture
} = _ref2;
const uniforms = {};

@@ -74,4 +80,6 @@ let width;

if (targetTextureVarying) {
width = targetTexture.width;
height = targetTexture.height;
({
width,
height
} = targetTexture);
uniforms["".concat(SIZE_UNIFORM_PREFIX).concat(targetTextureVarying)] = [width, height];

@@ -81,5 +89,6 @@ }

for (const textureName in sourceTextureMap) {
var _sourceTextureMap$tex = sourceTextureMap[textureName];
width = _sourceTextureMap$tex.width;
height = _sourceTextureMap$tex.height;
({
width,
height
} = sourceTextureMap[textureName]);
uniforms["".concat(SIZE_UNIFORM_PREFIX).concat(textureName)] = [width, height];

@@ -123,13 +132,14 @@ }

const type = attributeData.type,
name = attributeData.name;
const {
type,
name
} = attributeData;
if (name && textureMap[name]) {
const updatedLine = "// ".concat(line, " => Replaced by Transform with a sampler");
const _getSamplerDecleratio = getSamplerDeclerations(name),
samplerName = _getSamplerDecleratio.samplerName,
sizeName = _getSamplerDecleratio.sizeName,
uniformDeclerations = _getSamplerDecleratio.uniformDeclerations;
const {
samplerName,
sizeName,
uniformDeclerations
} = getSamplerDeclerations(name);
const channels = typeToChannelSuffix(type);

@@ -136,0 +146,0 @@ const sampleInstruction = " ".concat(type, " ").concat(name, " = transform_getInput(").concat(samplerName, ", ").concat(sizeName, ").").concat(channels, ";\n");

@@ -69,8 +69,6 @@ import { combineInjects } from '@luma.gl/shadertools';

getData() {
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$varyingName = _ref.varyingName,
varyingName = _ref$varyingName === void 0 ? null : _ref$varyingName,
_ref$packed = _ref.packed,
packed = _ref$packed === void 0 ? false : _ref$packed;
let {
varyingName = null,
packed = false
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const buffer = this.getBuffer(varyingName);

@@ -139,10 +137,12 @@

const _this$_getInputs = this._getInputs(),
attributes = _this$_getInputs.attributes,
uniforms = _this$_getInputs.uniforms;
const {
attributes,
uniforms
} = this._getInputs();
Object.assign(uniforms, opts.uniforms);
const parameters = Object.assign({}, opts.parameters);
const _opts$clearRenderTarg = opts.clearRenderTarget,
clearRenderTarget = _opts$clearRenderTarg === void 0 ? true : _opts$clearRenderTarg;
const {
clearRenderTarget = true
} = opts;
let framebuffer = null;

@@ -189,7 +189,9 @@ let discard = true;

const _opts$sourceBuffers = opts.sourceBuffers,
sourceBuffers = _opts$sourceBuffers === void 0 ? null : _opts$sourceBuffers,
_opts$feedbackBuffers = opts.feedbackBuffers,
feedbackBuffers = _opts$feedbackBuffers === void 0 ? null : _opts$feedbackBuffers;
const currentIndex = this.currentIndex;
const {
sourceBuffers = null,
feedbackBuffers = null
} = opts;
const {
currentIndex
} = this;

@@ -215,4 +217,6 @@ if (sourceBuffers || feedbackBuffers) {

const _sourceTextures = opts._sourceTextures,
_targetTexture = opts._targetTexture;
const {
_sourceTextures,
_targetTexture
} = opts;

@@ -273,11 +277,14 @@ if (_sourceTextures || _targetTexture) {

const _this$_validateProps = this._validateProps(props),
feedbackBuffers = _this$_validateProps.feedbackBuffers,
feedbackMap = _this$_validateProps.feedbackMap;
const {
feedbackBuffers,
feedbackMap
} = this._validateProps(props);
const sourceBuffers = props.sourceBuffers,
varyings = props.varyings,
_targetTexture = props._targetTexture,
_targetTextureVarying = props._targetTextureVarying,
_swapTexture = props._swapTexture;
const {
sourceBuffers,
varyings,
_targetTexture,
_targetTextureVarying,
_swapTexture
} = props;
let varyingsArray = varyings;

@@ -318,6 +325,10 @@

_validateProps(props) {
let feedbackBuffers = props.feedbackBuffers,
feedbackMap = props.feedbackMap;
const destinationBuffers = props.destinationBuffers,
sourceDestinationMap = props.sourceDestinationMap;
let {
feedbackBuffers,
feedbackMap
} = props;
const {
destinationBuffers,
sourceDestinationMap
} = props;

@@ -334,9 +345,13 @@ if (destinationBuffers) {

const vs = props.vs,
elementCount = props.elementCount,
varyings = props.varyings;
const _sourceTextures = props._sourceTextures,
_targetTexture = props._targetTexture,
_targetTextureVarying = props._targetTextureVarying,
_swapTexture = props._swapTexture;
const {
vs,
elementCount,
varyings
} = props;
const {
_sourceTextures,
_targetTexture,
_targetTextureVarying,
_swapTexture
} = props;
assert(vs && (varyings || feedbackMap || _targetTexture) && elementCount);

@@ -360,7 +375,7 @@

_setupBuffers(_ref2) {
let _ref2$sourceBuffers = _ref2.sourceBuffers,
sourceBuffers = _ref2$sourceBuffers === void 0 ? null : _ref2$sourceBuffers,
_ref2$feedbackBuffers = _ref2.feedbackBuffers,
feedbackBuffers = _ref2$feedbackBuffers === void 0 ? null : _ref2$feedbackBuffers;
_setupBuffers(_ref) {
let {
sourceBuffers = null,
feedbackBuffers = null
} = _ref;
this.sourceBuffers[0] = Object.assign({}, sourceBuffers);

@@ -379,4 +394,6 @@ this.feedbackBuffers[0] = Object.assign({}, feedbackBuffers);

let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const _sourceTextures = props._sourceTextures,
_targetTexture = props._targetTexture;
const {
_sourceTextures,
_targetTexture
} = props;
this.sourceTextures[0] = Object.assign({}, _sourceTextures);

@@ -420,4 +437,6 @@ this.sourceTextures[1] = {};

_createFeedbackBuffers(_ref3) {
let feedbackBuffers = _ref3.feedbackBuffers;
_createFeedbackBuffers(_ref2) {
let {
feedbackBuffers
} = _ref2;

@@ -435,5 +454,7 @@ if (!this.feedbackMap) {

const sourceBuffer = this.sourceBuffers[current][sourceBufferName];
const byteLength = sourceBuffer.byteLength,
usage = sourceBuffer.usage,
accessor = sourceBuffer.accessor;
const {
byteLength,
usage,
accessor
} = sourceBuffer;
const buffer = new Buffer(this.gl, {

@@ -508,9 +529,10 @@ byteLength,

const _this$_getShaders = this._getShaders(props),
vs = _this$_getShaders.vs,
fs = _this$_getShaders.fs,
modules = _this$_getShaders.modules,
uniforms = _this$_getShaders.uniforms,
inject = _this$_getShaders.inject,
samplerTextureMap = _this$_getShaders.samplerTextureMap;
const {
vs,
fs,
modules,
uniforms,
inject,
samplerTextureMap
} = this._getShaders(props);

@@ -557,5 +579,6 @@ this.model = new Model(this.gl, Object.assign({}, props, {

let _this$targetTextures$ = this.targetTextures[0],
width = _this$targetTextures$.width,
height = _this$targetTextures$.height;
let {
width,
height
} = this.targetTextures[0];
this.framebuffers[0] = new Framebuffer(this.gl, {

@@ -571,5 +594,6 @@ id: "".concat(this.id || 'transform', "-framebuffer-0"),

if (this._swapTexture) {
var _this$targetTextures$2 = this.targetTextures[1];
width = _this$targetTextures$2.width;
height = _this$targetTextures$2.height;
({
width,
height
} = this.targetTextures[1]);
this.framebuffers[1] = new Framebuffer(this.gl, {

@@ -611,8 +635,9 @@ id: "".concat(this.id || 'transform', "-framebuffer-1"),

const _this$_processVertexS = this._processVertexShader(props.vs),
vs = _this$_processVertexS.vs,
uniforms = _this$_processVertexS.uniforms,
targetTextureType = _this$_processVertexS.targetTextureType,
inject = _this$_processVertexS.inject,
samplerTextureMap = _this$_processVertexS.samplerTextureMap;
const {
vs,
uniforms,
targetTextureType,
inject,
samplerTextureMap
} = this._processVertexShader(props.vs);

@@ -619,0 +644,0 @@ const combinedInject = combineInjects([props.inject || {}, inject]);

@@ -13,7 +13,9 @@ import { Vector3 } from 'math.gl';

this.id = props.id || uid('light');
const _props$color = props.color,
color = _props$color === void 0 ? DEFAULT_LIGHT_COLOR : _props$color;
const {
color = DEFAULT_LIGHT_COLOR
} = props;
this.color = color;
const _props$intensity = props.intensity,
intensity = _props$intensity === void 0 ? DEFAULT_LIGHT_INTENSITY : _props$intensity;
const {
intensity = DEFAULT_LIGHT_INTENSITY
} = props;
this.intensity = intensity;

@@ -37,4 +39,5 @@ }

this.type = 'directional';
const _props$direction = props.direction,
direction = _props$direction === void 0 ? DEFAULT_LIGHT_DIRECTION : _props$direction;
const {
direction = DEFAULT_LIGHT_DIRECTION
} = props;
this.direction = new Vector3(direction).normalize().toArray();

@@ -49,4 +52,5 @@ }

this.type = 'point';
const _props$position = props.position,
position = _props$position === void 0 ? DEFAULT_LIGHT_POSITION : _props$position;
const {
position = DEFAULT_LIGHT_POSITION
} = props;
this.position = position;

@@ -53,0 +57,0 @@ this.attenuation = this._getAttenuation(props);

@@ -11,5 +11,8 @@ import Pass from './pass';

_renderPass(_ref) {
let gl = _ref.gl;
const _this$props$clearBits = this.props.clearBits,
clearBits = _this$props$clearBits === void 0 ? 16384 | 256 : _this$props$clearBits;
let {
gl
} = _ref;
const {
clearBits = 16384 | 256
} = this.props;
gl.clear(clearBits);

@@ -16,0 +19,0 @@ }

@@ -13,4 +13,5 @@ import Pass from './pass';

render() {
const _this$props$passes = this.props.passes,
passes = _this$props$passes === void 0 ? [] : _this$props$passes;
const {
passes = []
} = this.props;

@@ -17,0 +18,0 @@ for (const pass of passes) {

@@ -18,5 +18,8 @@ import ClipSpace from '../lib/clip-space';

_renderPass(_ref) {
let inputBuffer = _ref.inputBuffer;
const _this$props$opacity = this.props.opacity,
opacity = _this$props$opacity === void 0 ? 1.0 : _this$props$opacity;
let {
inputBuffer
} = _ref;
const {
opacity = 1.0
} = this.props;
this.clipspace.draw({

@@ -23,0 +26,0 @@ uniforms: {

@@ -12,3 +12,5 @@ import Pass from './pass';

_renderPass(_ref) {
let gl = _ref.gl;
let {
gl
} = _ref;
let writeValue = 1;

@@ -15,0 +17,0 @@ let clearValue = 0;

@@ -16,4 +16,5 @@ import CompositePass from './composite-pass';

this.renderState.reset();
const _this$props$passes = this.props.passes,
passes = _this$props$passes === void 0 ? [] : _this$props$passes;
const {
passes = []
} = this.props;

@@ -20,0 +21,0 @@ for (const pass of passes) {

import { Framebuffer, withParameters } from '@luma.gl/webgl';
export default class Pass {
constructor(gl, props) {
const _props$id = props.id,
id = _props$id === void 0 ? 'pass' : _props$id;
const {
id = 'pass'
} = props;
this.id = id;

@@ -56,6 +57,8 @@ this.gl = gl;

_renderPass(_ref) {
let gl = _ref.gl,
inputBuffer = _ref.inputBuffer,
outputBuffer = _ref.outputBuffer,
animationProps = _ref.animationProps;
let {
gl,
inputBuffer,
outputBuffer,
animationProps
} = _ref;
}

@@ -62,0 +65,0 @@

@@ -11,7 +11,9 @@ import Pass from './pass';

_renderPass(_ref) {
let animationProps = _ref.animationProps;
const _this$props = this.props,
_this$props$models = _this$props.models,
models = _this$props$models === void 0 ? [] : _this$props$models,
drawParams = _this$props.drawParams;
let {
animationProps
} = _ref;
const {
models = [],
drawParams
} = this.props;

@@ -18,0 +20,0 @@ for (const model of models) {

@@ -15,4 +15,6 @@ import Pass from './pass';

_renderPass(_ref) {
let inputBuffer = _ref.inputBuffer,
swapBuffers = _ref.swapBuffers;
let {
inputBuffer,
swapBuffers
} = _ref;
this.props.model.setUniforms(this.props);

@@ -47,4 +49,6 @@ this.props.model.draw({

_renderPass(_ref2) {
let inputBuffer = _ref2.inputBuffer,
swapBuffers = _ref2.swapBuffers;
let {
inputBuffer,
swapBuffers
} = _ref2;
let first = true;

@@ -51,0 +55,0 @@

@@ -26,6 +26,8 @@ import { withParameters, setParameters } from '@luma.gl/webgl';

_renderPass(_ref) {
let gl = _ref.gl,
inputBuffer = _ref.inputBuffer,
outputBuffer = _ref.outputBuffer,
animationPropst = _ref.animationPropst;
let {
gl,
inputBuffer,
outputBuffer,
animationPropst
} = _ref;
const stencilReadMask = getMask(this.props.stencils);

@@ -32,0 +34,0 @@ const stencilWriteMask = getMask(this.props.updateStencil);

@@ -10,5 +10,6 @@ import { default as ClipSpace } from '../lib/clip-space';

}, options));
const texture = options.texture,
_options$opacity = options.opacity,
opacity = _options$opacity === void 0 ? 1.0 : _options$opacity;
const {
texture,
opacity = 1.0
} = options;
this.clipspace = new ClipSpace(gl, {

@@ -15,0 +16,0 @@ id: 'texture-pass',

@@ -10,5 +10,5 @@ import { Matrix4 } from 'math.gl';

} : props;
const _props = props,
_props$children = _props.children,
children = _props$children === void 0 ? [] : _props$children;
const {
children = []
} = props;
children.every(child => assert(child instanceof ScenegraphNode));

@@ -58,6 +58,5 @@ super(props);

traverse(visitor) {
let _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$worldMatrix = _ref.worldMatrix,
worldMatrix = _ref$worldMatrix === void 0 ? new Matrix4() : _ref$worldMatrix;
let {
worldMatrix = new Matrix4()
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
const modelMatrix = new Matrix4(worldMatrix).multiplyRight(this.matrix);

@@ -64,0 +63,0 @@

@@ -5,3 +5,5 @@ import { Vector3, Matrix4 } from 'math.gl';

constructor(props) {
const id = props.id;
const {
id
} = props;
this.id = id || uid(this.constructor.name);

@@ -60,7 +62,8 @@ this.display = true;

setMatrixComponents(_ref) {
let position = _ref.position,
rotation = _ref.rotation,
scale = _ref.scale,
_ref$update = _ref.update,
update = _ref$update === void 0 ? true : _ref$update;
let {
position,
rotation,
scale,
update = true
} = _ref;

@@ -98,6 +101,7 @@ if (position) {

update() {
let _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
position = _ref2.position,
rotation = _ref2.rotation,
scale = _ref2.scale;
let {
position,
rotation,
scale
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

@@ -104,0 +108,0 @@ if (position) {

{
"name": "@luma.gl/core",
"version": "7.1.0-alpha.4",
"version": "7.1.0-alpha.5",
"description": "WebGL2 Components for High Performance Rendering and Computation",

@@ -33,11 +33,12 @@ "license": "MIT",

"@babel/runtime": "^7.0.0",
"@luma.gl/constants": "7.1.0-alpha.4",
"@luma.gl/shadertools": "7.1.0-alpha.4",
"@luma.gl/webgl": "7.1.0-alpha.4",
"@luma.gl/webgl-state-tracker": "7.1.0-alpha.4",
"@luma.gl/webgl2-polyfill": "7.1.0-alpha.4",
"@luma.gl/constants": "7.1.0-alpha.5",
"@luma.gl/shadertools": "7.1.0-alpha.5",
"@luma.gl/webgl": "7.1.0-alpha.5",
"@luma.gl/webgl-state-tracker": "7.1.0-alpha.5",
"@luma.gl/webgl2-polyfill": "7.1.0-alpha.5",
"math.gl": "^2.3.0",
"probe.gl": "^3.0.2",
"seer": "^0.2.4"
}
},
"gitHead": "ef39b904ae17a9bc257b79f63aa1db1671e97b48"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc