Files
nick 283d057507
CI / build-and-test (push) Successful in 2m5s
chore(wip): attempting to get shaders working again
2026-03-06 14:51:54 +13:00

22 lines
534 B
GLSL

#version 330
in vec3 fragNormal;
in vec3 fragPosition;
uniform vec4 albedo;
uniform vec3 lightDir;
out vec4 fragColor;
void main() {
// Use uniform light direction, with fallback
vec3 light = normalize(lightDir);
float bandCount = 3.0;
vec3 normal = normalize(fragNormal);
float intensity = max(dot(normal, light), 0.0);
intensity = floor(intensity * bandCount) / bandCount;
intensity = max(intensity, 0.3); // Minimum visibility
fragColor = vec4(albedo.rgb * intensity, albedo.a);
}