
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
kami-texture2
Advanced tools
2D texture utility for kami, but can be used stand-alone with other WebGL engines (ThreeJS, StackGL, etc). Often rendered using kami-batch.
//get a webGL context somehow
var gl = require('webgl-context');
//load an image onto the GPU...
var tex = require('kami-texture')(gl, {
src: 'img/blah.png'
});
//setup filters if you want
tex.setFilter(gl.LINEAR);
//render it with kami-batch or another lib...
For full details, see the kami API docs. Here is the module at a glance.
Texture(gl, options)The constructor. Can specify an image in options:
src: the image source URIcrossOrigin: a string to pass onto the Image object, or undefinedonLoad: called when the image is loadedonError: called if there was an error loading the imageOr you can specify the raw data directly:
data or image: an array of pixels, typically Uint8Array, or an HTML Image/Video objectformat: a gl format, default RGBA. The constants are aliased onto Texture.Formattype: a gl type for the data array, default UNSIGNED_BYTE. The constants are aliased onto Texture.DataTypewidth: the width of the data (only needed if you specified data)height: the height of the data (only needed if you specified data)If no data or image is specified, null (empty) data is uploaded in place. There are also a couple other parameters which can be used with images or data constructor:
genMipmaps: whether to generate mipmaps, default falsetex.width, tex.heightDimensions of the texture. You can also use tex.shape which returns an array of [width, height] (similar to gl-texture2d).
tex.idThe WebGLTexture identifier.
tex.setFilter(min, mag)Sets the min and mag filter. LINEAR, NEAREST, etc. constants are aliased onto Texture.Filter. If a single argument is passed, it will be applied to both min and mag. The default filters for all new textures is NEAREST.
This will bind the texture before applying the parameters.
tex.setWrap(s, t)Sets the texture wrap mode. REPEAT, CLAMP_TO_EDGE, etc. are aliased onto Texture.Wrap.
This will bind the texture before applying the parameters.
tex.bind(n)If a number is passed, that texture slot will be made active and this texture bound to it. Otherwise, the texture will be bound to whatever texture slot is currently active.
uploadData(width, height, format, type, data, genMipmaps)Calls glTexImage2D with the given parameters, and a data array as input.
uploadImage(domObject, format, type, genMipmaps)Calls glTexImage2D with the given parameters, and an HTML image as input.
MIT, see LICENSE.md for details.
FAQs
texture utils for kami
The npm package kami-texture2 receives a total of 3 weekly downloads. As such, kami-texture2 popularity was classified as not popular.
We found that kami-texture2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.