New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ogl

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ogl - npm Package Compare versions

Comparing version 0.0.89 to 0.0.90

2

package.json
{
"name": "ogl",
"version": "0.0.89",
"version": "0.0.90",
"description": "WebGL Library",

@@ -5,0 +5,0 @@ "main": "src/index.mjs",

@@ -95,5 +95,5 @@ <p align="center">

```js
import { Renderer, Camera, Transform, Box, Program, Mesh } from 'ogl';
{
import {Renderer, Camera, Transform, Box, Program, Mesh } from 'ogl';
const renderer = new Renderer();

@@ -120,3 +120,3 @@ const gl = renderer.gl;

const program = new Program(gl, {
vertex: `
vertex: /* glsl */ `
attribute vec3 position;

@@ -130,4 +130,4 @@

}
`,
fragment: `
`,
fragment: /* glsl */ `
void main() {

@@ -139,3 +139,3 @@ gl_FragColor = vec4(1.0);

const mesh = new Mesh(gl, {geometry, program});
const mesh = new Mesh(gl, { geometry, program });
mesh.setParent(scene);

@@ -149,3 +149,3 @@

mesh.rotation.x += 0.03;
renderer.render({scene, camera});
renderer.render({ scene, camera });
}

@@ -160,3 +160,3 @@ }

```js
import {Renderer, Geometry, Program, Mesh} from 'ogl';
import { Renderer, Geometry, Program, Mesh } from 'ogl';

@@ -173,4 +173,4 @@ {

const geometry = new Geometry(gl, {
position: {size: 2, data: new Float32Array([-1, -1, 3, -1, -1, 3])},
uv: {size: 2, data: new Float32Array([0, 0, 2, 0, 0, 2])},
position: { size: 2, data: new Float32Array([-1, -1, 3, -1, -1, 3]) },
uv: { size: 2, data: new Float32Array([0, 0, 2, 0, 0, 2]) },
});

@@ -180,3 +180,3 @@ // Alternatively, you could use the Triangle class.

const program = new Program(gl, {
vertex: `
vertex: /* glsl */ `
attribute vec2 uv;

@@ -192,3 +192,3 @@ attribute vec2 position;

`,
fragment: `
fragment: /* glsl */ `
precision highp float;

@@ -206,7 +206,7 @@

uniforms: {
uTime: {value: 0},
uTime: { value: 0 },
},
});
const mesh = new Mesh(gl, {geometry, program});
const mesh = new Mesh(gl, { geometry, program });

@@ -220,3 +220,3 @@ requestAnimationFrame(update);

// Don't need a camera if camera uniforms aren't required
renderer.render({scene: mesh});
renderer.render({ scene: mesh });
}

@@ -223,0 +223,0 @@ }

@@ -551,10 +551,11 @@ import { Geometry } from '../core/Geometry.js';

});
}
if (isLightmap) {
geometry.addAttribute('lightmapScaleOffset', {
instanced: 1,
size: 4,
data: new Float32Array(numInstances * 4),
});
}
// Always supply lightmapScaleOffset as an instanced attribute
if (isLightmap) {
geometry.addAttribute('lightmapScaleOffset', {
instanced: 1,
size: 4,
data: new Float32Array(numInstances * 4),
});
}

@@ -670,2 +671,3 @@

let isFirstInstance = true;
let isInstancedMatrix = false;

@@ -677,2 +679,3 @@ // add mesh if included

// instanced mesh might only have 1
if (mesh.geometry.isInstanced) {

@@ -685,3 +688,6 @@ isInstanced = true;

}
node.matrix.toArray(mesh.geometry.attributes.instanceMatrix.data, mesh.instanceCount * 16);
if (mesh.geometry.attributes.instanceMatrix) {
isInstancedMatrix = true;
node.matrix.toArray(mesh.geometry.attributes.instanceMatrix.data, mesh.instanceCount * 16);
}

@@ -699,4 +705,5 @@ if (mesh.geometry.attributes.lightmapScaleOffset && extras && extras.lightmap_scale_offset) {

// Flag attribute as dirty
mesh.geometry.attributes.instanceMatrix.needsUpdate = true;
if (mesh.geometry.attributes.instanceMatrix) {
mesh.geometry.attributes.instanceMatrix.needsUpdate = true;
}
if (mesh.geometry.attributes.lightmapScaleOffset) {

@@ -718,3 +725,3 @@ mesh.geometry.attributes.lightmapScaleOffset.needsUpdate = true;

// Reset node if instanced to not duplicate transforms
if (isInstanced) {
if (isInstancedMatrix) {
// Remove unused nodes just providing an instance transform

@@ -721,0 +728,0 @@ if (!isFirstInstance) return null;

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