A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
| Name | Stars | Last Commit | Description |
|---|---|---|---|
| three.js | ![GitHub |
| float map(float value, float min1, float max1, float min2, float max2) { | |
| return min2 + (value - min1) * (max2 - min2) / (max1 - min1); | |
| } |
| var cameraZ = camera.position.z; | |
| var planeZ = 5; | |
| var distance = cameraZ - planeZ; | |
| var aspect = viewWidth / viewHeight; | |
| var vFov = camera.fov * Math.PI / 180; | |
| var planeHeightAtDistance = 2 * Math.tan(vFov / 2) * distance; | |
| var planeWidthAtDistance = planeHeightAtDistance * aspect; | |
| // or |
A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
| Name | Stars | Last Commit | Description |
|---|---|---|---|
| three.js | ![GitHub |
| // Sobel Edge Detection Filter | |
| // GLSL Fragment Shader | |
| // Implementation by Patrick Hebron | |
| uniform sampler2D texture; | |
| uniform float width; | |
| uniform float height; | |
| void make_kernel(inout vec4 n[9], sampler2D tex, vec2 coord) | |
| { |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParentPlease consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);