added models and stuff

This commit is contained in:
2026-05-08 23:44:20 -04:00
parent 3c756d6230
commit 5484e265fb
24 changed files with 3281 additions and 199575 deletions

View File

@@ -29,6 +29,7 @@ void main() {
vec3 norm = normalize(Normal);
vec3 lightDir = normalize(-lightDirection);
vec3 viewDir = normalize(viewPosition - Position);
vec3 halfwayDir = normalize(lightDir + viewDir);
vec3 ambient = lightAmbient * (diffuseColor * phongAmbient);
@@ -37,9 +38,11 @@ void main() {
vec3 reflectDir = reflect(-lightDir, norm);
float effectiveShininess = max(phongShininess, 1.0);
float spec = pow(max(dot(viewDir, reflectDir), 0.0), effectiveShininess);
float spec = pow(max(dot(norm, halfwayDir), 0.0), effectiveShininess);
vec3 specular = lightSpecular * (spec * specularColor * phongSpecular);
vec3 result = ambient + diffuse + specular;
FragColor = vec4(result, 1.0);
float gamma = 2.2;
FragColor.rgb = pow(result.rgb, vec3(1.0/gamma));
}