Set up for debugging

This commit is contained in:
Abdelrahman Said 2024-08-25 02:49:25 +01:00
parent 57dcf6457c
commit c39efad8fb
2 changed files with 19 additions and 10 deletions

View File

@ -32,16 +32,22 @@ int main(void) {
return TINY_EXIT_RENDER_INIT_FAILED;
}
Model obj = load_obj_file(arena, RESOURCE("head.obj"), RESOURCE("head.pnm"),
RESOURCE("head_nm.pnm"));
// Model obj = load_obj_file(arena, RESOURCE("head.obj"),
// RESOURCE("head.pnm"),
// RESOURCE("head_nm.pnm"));
Model obj =
load_obj_file(arena, RESOURCE("polygon.obj"), RESOURCE("grid.pnm"), NULL);
if (IS_INVALID_MODEL(obj)) {
return TINY_EXIT_MODEL_LOAD_FAILED;
}
PhongMaterial material = {
.ambient = 0.3f,
.diffuse = 1.5f,
.specular = 0.5f,
// .ambient = 0.3f,
// .diffuse = 1.5f,
// .specular = 0.5f,
.ambient = 2.0f,
.diffuse = 0.0f,
.specular = 0.0f,
.shininess = 0.1f,
};
obj.material = material;

View File

@ -46,11 +46,14 @@ internal M4x4f get_projection_matrix(ProjectionType projection_type);
internal f32 get_intensity(const V3f *normal);
void load_shaders(void) {
M4x4f model_view = lookat(g_eye, g_target, g_up);
M4x4f orthographic_projection =
get_projection_matrix(PROJECTION_TYPE_ORTHOGRAPHIC);
M4x4f perspective_projection =
get_projection_matrix(PROJECTION_TYPE_PERSPECTIVE);
// M4x4f model_view = lookat(g_eye, g_target, g_up);
// M4x4f orthographic_projection =
// get_projection_matrix(PROJECTION_TYPE_ORTHOGRAPHIC);
// M4x4f perspective_projection =
// get_projection_matrix(PROJECTION_TYPE_PERSPECTIVE);
M4x4f model_view = mat4x4_identity;
M4x4f orthographic_projection = mat4x4_identity;
M4x4f perspective_projection = mat4x4_identity;
perspective.model_view = orthographic.model_view = model_view;
perspective.projection = perspective_projection;