Fixed cdf and added Standard Lit

This commit is contained in:
2025-12-29 22:01:44 +09:00
parent e1693764f7
commit adee5acd10
24 changed files with 830 additions and 570 deletions

View File

@@ -41,53 +41,4 @@ inline void quad_create(vec3s center, vec3s forward, vec3s up, float size, uint8
triangle_create(vertex_1, vertex_2, vertex_3, material_id, collection);
}
// inline void sphere_create(vec3s center, float radius, uint8_t material_id, triangle_collection_t* collection)
// {
// int segments = 16;
// int rings = 16;
//
// for (int i = 0; i < rings; i++)
// {
// float theta1 = (float)i / (float)rings * (float)M_PI;
// float theta2 = (float)(i + 1) / (float)rings * (float)M_PI;
//
// for (int j = 0; j < segments; j++)
// {
// float phi1 = (float)j / (float)segments * 2.0f * (float)M_PI;
// float phi2 = (float)(j + 1) / (float)segments * 2.0f * (float)M_PI;
//
// vec3s p1 = {
// center.x + radius * sinf(theta1) * cosf(phi1),
// center.y + radius * cosf(theta1),
// center.z + radius * sinf(theta1) * sinf(phi1)
// };
// vec3s p2 = {
// center.x + radius * sinf(theta2) * cosf(phi1),
// center.y + radius * cosf(theta2),
// center.z + radius * sinf(theta2) * sinf(phi1)
// };
// vec3s p3 = {
// center.x + radius * sinf(theta2) * cosf(phi2),
// center.y + radius * cosf(theta2),
// center.z + radius * sinf(theta2) * sinf(phi2)
// };
// vec3s p4 = {
// center.x + radius * sinf(theta1) * cosf(phi2),
// center.y + radius * cosf(theta1),
// center.z + radius * sinf(theta1) * sinf(phi2)
// };
//
// // vec3s n1 = glms_vec3_normalize(glms_vec3_sub(p1, center));
// // vec3s n2 = glms_vec3_normalize(glms_vec3_sub(p2, center));
// // vec3s n3 = glms_vec3_normalize(glms_vec3_sub(p3, center));
// // vec3s n4 = glms_vec3_normalize(glms_vec3_sub(p4, center));
//
// // triangle_create_with_normals(p3, p2, p1, n3, n2, n1, material_id, collection);
// // triangle_create_with_normals(p3, p1, p4, n3, n1, n4, material_id, collection);
// triangle_create(p3, p2, p1, material_id, collection);
// triangle_create(p3, p1, p4, material_id, collection);
// }
// }
// }
#endif // GEOMETRY_UTILITIES_H

View File

@@ -19,8 +19,8 @@ typedef struct
uint64_t triangle_count;
uint16_t material_id;
uint16_t material_count;
} mesh_entity_t;
} mesh_handle_t;
mesh_entity_t mesh_load(const char* filename, scene_t* scene);
mesh_handle_t mesh_load(const char* filename, scene_t* scene);
#endif // MESH_H