Switch to using tangent normals

This commit is contained in:
Abdelrahman Said 2024-08-24 00:48:46 +01:00
parent 798100f138
commit 1f5f01d73f
3 changed files with 4 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 KiB

After

Width:  |  Height:  |  Size: 588 KiB

View File

@ -33,14 +33,14 @@ int main(void) {
} }
Model obj = load_obj_file(arena, RESOURCE("head.obj"), RESOURCE("head.pnm"), Model obj = load_obj_file(arena, RESOURCE("head.obj"), RESOURCE("head.pnm"),
RESOURCE("head_nm.pnm")); RESOURCE("head_nm_tangent.pnm"));
if (IS_INVALID_MODEL(obj)) { if (IS_INVALID_MODEL(obj)) {
return TINY_EXIT_MODEL_LOAD_FAILED; return TINY_EXIT_MODEL_LOAD_FAILED;
} }
PhongMaterial material = { PhongMaterial material = {
.ambient = 0.1f, .ambient = 0.3f,
.diffuse = 1.2f, .diffuse = 1.0f,
.specular = 0.1f, .specular = 0.1f,
.shininess = 0.8f, .shininess = 0.8f,
}; };

View File

@ -25,7 +25,7 @@ internal V3f g_ambient_light = {0.6f, 0.45f, 0.55f};
internal DirectionalLight g_directional_light = { internal DirectionalLight g_directional_light = {
.diffuse_intensity = {0.9f, 1.0f, 1.0f}, .diffuse_intensity = {0.9f, 1.0f, 1.0f},
.specular_intensity = {1.0f, 0.8f, 2.0f}, .specular_intensity = {1.0f, 0.8f, 2.0f},
.direction = {0.0f, 0.0f, 1.5f}, .direction = {0.0f, 0.0f, 1.45f},
}; };
internal V3f g_eye = {0.2f, 0.1f, 0.75f}; internal V3f g_eye = {0.2f, 0.1f, 0.75f};
internal V3f g_target = {0}; internal V3f g_target = {0};