Set C standard to C11 and add new assets
Changed CMakeLists.txt to set the C standard to C11. Added multiple binary image files for new visual assets. Added several new image files to enhance rendering capabilities. Changed stb_image.h to improve support for various image formats. Changed ray tracing engine to enhance ray creation and intersection. Changed triangle structure to use a vertex array for better attribute handling. Changed scene initialization to accommodate new texture management.
This commit is contained in:
@@ -3,19 +3,20 @@
|
||||
#include <svpng.inc>
|
||||
|
||||
#include "Algorithm/Sobol.h"
|
||||
// #include "Geometry/GeometryUtilities.h"
|
||||
#include "Geometry/Mesh.h"
|
||||
#include "Lighting/SkyLight.h"
|
||||
#include "Material/SimpleLit.h"
|
||||
// #include "Material/SimpleLit.h"
|
||||
#include "Rendering/PostProcessing.h"
|
||||
#include "Rendering/Scene.h"
|
||||
#include "Window.h"
|
||||
|
||||
#define TITLE "Path Tracing"
|
||||
#define SPONZA_PATH "./assets/sponza.obj"
|
||||
#define SPONZA_PATH "./assets/sponza.fbx"
|
||||
|
||||
static bool scene_setup(scene_t* scene)
|
||||
{
|
||||
if (!scene_init(scene, 67000, 8, 1))
|
||||
if (!scene_init(scene, 167000, 3, 8, 1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -26,7 +27,7 @@ static bool scene_setup(scene_t* scene)
|
||||
// TODO: Standardize light unit
|
||||
light_entity_t sun = light_create_directional_light(&scene->lights);
|
||||
directional_light_t* sun_light = &scene->lights.directional_lights[sun.id];
|
||||
sun_light->direction = glms_vec3_normalize((vec3s){-0.5f, 1.0f, 0.15f});
|
||||
sun_light->direction = glms_vec3_normalize((vec3s){-0.5f, 1.0f, 0.25f});
|
||||
sun_light->color = (vec3s){1.0f, 0.93f, 0.87f};
|
||||
sun_light->intensity = 2.0f;
|
||||
sun_light->angular_diameter = 0.53f;
|
||||
@@ -42,16 +43,8 @@ static bool scene_setup(scene_t* scene)
|
||||
|
||||
static bool load_assets(scene_t* scene)
|
||||
{
|
||||
simple_lit_data_t floor_lit_data =
|
||||
{
|
||||
.albedo = (vec3s){1.0f, 1.0f, 1.0f},
|
||||
.roughness = 0.95f,
|
||||
.metallic = 0.0f,
|
||||
};
|
||||
|
||||
material_entity_t floor_material = material_create_simple_lit(&floor_lit_data, &scene->materials);
|
||||
|
||||
mesh_load(SPONZA_PATH, floor_material.id, &scene->triangles, &scene->materials);
|
||||
mesh_load(SPONZA_PATH, scene);
|
||||
// quad_create((vec3s){0.0f, 0.0f, 0.0f}, (vec3s){0.0f, 1.0f, 0.0f}, (vec3s){1.0f, 0.0f, 0.0f}, 10.0f, floor_material.id, &scene->triangles);
|
||||
|
||||
return scene_build_bvh(scene);
|
||||
}
|
||||
@@ -157,14 +150,14 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
|
||||
{
|
||||
omp_set_num_threads(16);
|
||||
|
||||
scene_t scene;
|
||||
render_target_t img;
|
||||
scene_t scene = {0};
|
||||
render_target_t img = {0};
|
||||
render_job_t* job = NULL;
|
||||
|
||||
rendering_config_t config = {
|
||||
.width = 1920 / 2,
|
||||
.height = 1080 / 2,
|
||||
.sample_count = 64 * 4,
|
||||
.sample_count = 64 * 1,
|
||||
.max_depth = 4,
|
||||
.bucket_size = 64,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user