fixed a lot of stuff with camera and importing

This commit is contained in:
2026-05-03 12:43:39 -04:00
parent 68020255d0
commit 9a8e618bbb
9 changed files with 73488 additions and 55 deletions

View File

@@ -10,7 +10,7 @@ Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
map_Kd diffuse.jpg
map_Bump normal.png
map_Ks specular.jpg
map_Kd backpack/diffuse.jpg
map_Bump backpack/normal.png
map_Ks backpack/specular.jpg

73398
resources/male.obj Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,8 @@ in vec3 Position;
in vec2 TexCoord;
in vec3 Normal;
uniform sampler2D diffuse;
uniform vec3 viewPosition;
uniform vec3 phongAmbient;
@@ -19,13 +21,15 @@ uniform vec3 lightDiffuse;
uniform vec3 lightSpecular;
void main() {
vec4 diffuseColor = texture(diffuse, TexCoord);
vec3 norm = normalize(Normal);
vec3 lightDir = normalize(-lightDirection);
vec3 ambient = (phongAmbient);
vec3 ambient = phongAmbient * vec3(diffuseColor);
float diffImpact = max(dot(norm, lightDir), 0.0);
vec3 diffuse = (phongDiffuse * diffImpact);
vec3 diffuse = (phongDiffuse * vec3(diffuseColor)) * diffImpact;
vec3 result = ambient + diffuse;
FragColor = vec4(result, 1.0);