Skip to content

Instantly share code, notes, and snippets.

View devloop01's full-sized avatar
🏠
Working from home

Sikriti Dakua devloop01

🏠
Working from home
View GitHub Profile
@raphaelameaume
raphaelameaume / uvCover.glsl
Created May 29, 2020 15:01
Simulate background:size cover in fragment shader
vec2 uvCover (vec2 uv, vec2 size, vec2 resolution) {
vec2 coverUv = uv;
vec2 s = resolution; // Screen
vec2 i = size; // Image
float rs = s.x / s.y;
float ri = i.x / i.y;
vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x);
vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new;
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active June 19, 2024 08:09
A collection of WebGL and WebGPU frameworks and libraries

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.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active June 21, 2024 05:12
GLSL Noise Algorithms

Please 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

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);