Initial commit - some engine bugs stopping compiling

This commit is contained in:
Will
2026-03-29 15:52:42 +01:00
commit 3d573a200e
361 changed files with 332759 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#version 410 core
in vec3 FragPos;
in vec3 Normal;
in vec3 Color;
out vec4 FragColor;
uniform vec3 uLightPos;
uniform vec3 uViewPos;
uniform vec3 uLightColor;
uniform float uAmbientStrength;
uniform float uSpecularStrength;
uniform float uShininess;
void main() {
// Normalize the normal vector
vec3 norm = normalize(Normal);
// Ambient lighting
vec3 ambient = uAmbientStrength * uLightColor;
// Diffuse lighting
vec3 lightDir = normalize(uLightPos - FragPos);
float diff = max(dot(norm, lightDir), 0.0);
vec3 diffuse = diff * uLightColor;
// Specular lighting
vec3 viewDir = normalize(uViewPos - FragPos);
vec3 reflectDir = reflect(-lightDir, norm);
float spec = pow(max(dot(viewDir, reflectDir), 0.0), uShininess);
vec3 specular = uSpecularStrength * spec * uLightColor;
// Combine results
vec3 result = (ambient + diffuse + specular) * Color;
FragColor = vec4(result, 1.0);
}