Skip to content

Instantly share code, notes, and snippets.

View BelmuTM's full-sized avatar
🌺
Beep Boop

Belmu BelmuTM

🌺
Beep Boop
View GitHub Profile
@LVutner
LVutner / LabPBR template
Last active September 29, 2023 15:22
LabPBR unpacking template (1.3)
//Sample textures
vec4 albedo_tex = texture2D(texture, texcoord);
vec4 normal_tex = texture2D(normals, texcoord);
vec4 specular_tex = texture2D(specular, texcoord);
//Gamma correction - Optional if you're not doing gamma correct lighting
albedo_tex.xyz = pow(albedo_tex.xyz, vec3(2.2));
//Normals
vec3 normal;
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active July 15, 2024 12:10
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);