started fixing stuff with model imports

This commit is contained in:
2026-05-03 00:08:13 -05:00
parent 782bbcbadc
commit 68020255d0
13 changed files with 199571 additions and 81 deletions

BIN
resources/backpack/ao.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -0,0 +1,16 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl Scene_-_Root
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
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

199481
resources/backpack/backpack.obj Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

View File

@@ -0,0 +1,3 @@
Model by Berk Gedik, from: https://sketchfab.com/3d-models/survival-guitar-backpack-low-poly-799f8c4511f84fab8c3f12887f7e6b36
Modified material assignment (Joey de Vries) for easier load in OpenGL model loading chapter, and renamed albedo to diffuse and metallic to specular to match non-PBR lighting setup.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 MiB

View File

@@ -8,35 +8,25 @@ in vec3 Normal;
uniform vec3 viewPosition;
uniform sampler2D diffuse1;
uniform sampler2D specular1;
uniform vec3 phongAmbient;
uniform vec3 phongDiffuse;
uniform vec3 phongSpecular;
uniform float phongShininess;
uniform vec3 lightPos;
uniform vec3 lightDirection;
uniform vec3 lightAmbient;
uniform vec3 lightDiffuse;
uniform vec3 lightSpecular;
void main() {
vec3 diffColor = texture(diffuse1, TexCoord).rgb;
vec3 specColor = texture(specular1, TexCoord).rgb;
vec3 ambient = (phongAmbient * diffColor) * lightAmbient;
vec3 norm = normalize(Normal);
vec3 lightDir = normalize(lightPos - Position);
vec3 lightDir = normalize(-lightDirection);
vec3 ambient = (phongAmbient);
float diffImpact = max(dot(norm, lightDir), 0.0);
vec3 diffuse = (phongDiffuse * diffImpact * diffColor) * lightDiffuse;
vec3 diffuse = (phongDiffuse * diffImpact);
vec3 viewDir = normalize(viewPosition - Position);
vec3 halfwayDir = normalize(lightDir + viewDir);
float specImpact = pow(max(dot(norm, halfwayDir), 0.0), phongShininess);
vec3 specular = (phongSpecular * specImpact * specColor) * lightSpecular;
vec3 result = ambient + diffuse + specular;
vec3 result = ambient + diffuse;
FragColor = vec4(result, 1.0);
}