Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@luma.gl/shadertools
Advanced tools
@luma.gl/shadertools is a collection of tools for working with WebGL shaders. It provides utilities for shader transpilation, shader module management, and shader debugging, making it easier to develop and manage complex WebGL applications.
Shader Transpilation
This feature allows you to transpile GLSL code to be compatible with different versions of WebGL. The code sample demonstrates how to transpile a simple GLSL fragment shader to WebGL2.
const { transpileShader } = require('@luma.gl/shadertools');
const glslCode = `
void main() {
gl_FragColor = vec4(1.0);
}
`;
const transpiledCode = transpileShader(glslCode, { target: 'webgl2' });
console.log(transpiledCode);
Shader Module Management
This feature helps in managing and assembling shader modules. The code sample shows how to assemble vertex and fragment shaders along with additional shader modules.
const { assembleShaders } = require('@luma.gl/shadertools');
const vs = `
attribute vec4 position;
void main() {
gl_Position = position;
}
`;
const fs = `
void main() {
gl_FragColor = vec4(1.0);
}
`;
const modules = [
{ name: 'module1', vs, fs }
];
const assembledShaders = assembleShaders({ vs, fs, modules });
console.log(assembledShaders);
Shader Debugging
This feature provides tools for parsing and debugging GLSL code. The code sample demonstrates how to parse a simple GLSL fragment shader to get an abstract syntax tree (AST) representation.
const { parseGLSL } = require('@luma.gl/shadertools');
const glslCode = `
void main() {
gl_FragColor = vec4(1.0);
}
`;
const parsedShader = parseGLSL(glslCode);
console.log(parsedShader);
glslify is a module system for GLSL that allows you to write modular and reusable shader code. It is similar to @luma.gl/shadertools in that it helps manage shader code, but it focuses more on modularity and reusability rather than transpilation and debugging.
three.js is a popular 3D library that includes extensive support for shaders. While it is a more comprehensive library for 3D graphics, it also provides utilities for shader management and debugging, similar to @luma.gl/shadertools.
glslang is a reference front-end for GLSL, providing tools for parsing and compiling GLSL code. It is similar to @luma.gl/shadertools in its focus on shader parsing and debugging, but it is more low-level and closer to the Vulkan ecosystem.
This is the shader module system module for luma.gl.
See luma.gl for documentation.
FAQs
Shader module system for luma.gl
The npm package @luma.gl/shadertools receives a total of 157,319 weekly downloads. As such, @luma.gl/shadertools popularity was classified as popular.
We found that @luma.gl/shadertools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.