
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
___________ ________.____
\_ _____/___________ / _____/| |
| __) \_ __ \__ \ / \ ___| |
| \ | | \// __ \\ \_\ \ |___
\___ / |__| (____ /\______ /_______ \
\/ \/ \/ \/
This is a small lib for WebGl shader effects.
// import the fragl lib
import FraGL from 'FraGL'
// get canvas
const canvas = document.querySelector('.canvas');
// pass canvas to fragl constructor
const fragl = new FraGL(args)
So thats the basic setup, contructor args are all optional, if no canvas is given then it will create a canvas element and it will be stored at fragl.domElement
// defautls
const args = {
canvas: canvasDomEl,
clearColor: [0,0,0,0],
imageLoadColor = [255, 150, 150, 255],
size:{
width: window.innerWidth,
height: window.innerHeight
},
trasparent: false,
premultipliedAlpha: false,
antialias: false
depth: false
}
fragl.setSize(width,height)
//.createRenderLayer( 'name'= String, args = Object );
const renderLayer = fragl.createRenderLayer('render-layer', {
uniforms:{
// dummy uniforms made up for the sake of demonstration
u_res:{
value: [ width, height ] // vec2
},
u_texture:{
value: texture // texture
},
u_val:{
value: 1. // float
}
},
vertex:vertexShader, // string
fragment:fragmentShader // string
})
renderLayer.uniforms['u_res'].value = [ width, height ]
const texture = fragl.textureFromImage('./path/to/image.jpg');
const renderTexture = fragl.createRenderTexture({
width: window.innerWidth,
height: window.innerHeight
});
renderLayer.uniforms['u_texture'].value = renderTexture.texture
and to resize
renderTexture.setSize(w,h)
// render to canvas
renderLayer.render()
// render to renderTexture
renderLayer.render(renderTexture)
an example
render(){
renderLayer1.render(renderTexture)
renderLayer2.uniforms['u_texure'].value = renderTexture.texture
renderLayer2.render()
}
Something like this should be the base for your vertex shader
precision highp float;
attribute vec2 a_position;
attribute vec2 a_texcoord;
varying vec2 vUv;
void main() {
vUv = a_texcoord;
gl_Position = vec4(a_position, 0, 1);;
}
FAQs
Small WebGL lib for shader compositions
The npm package fragl receives a total of 11 weekly downloads. As such, fragl popularity was classified as not popular.
We found that fragl 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.