Files
SimpleRayTracing/header/Rendering/Scene.h
Misaki 6800810369 Update project structure and improve performance
Added new files for BVH, AABB, and Debug functionalities.
Added new utility functions in Common.h.
Added gamma correction function in PostProcessing.h.
Changed the return type of path_trace to vec4s for alpha blending.
Changed BSDF function signatures to include sample index and bounce.
Changed the BSDF.h to replace inline functions with declarations.
Changed the Light and SkyLight evaluation functions to include throughput and sample index.
Changed the sphere creation function in GeometryUtilities.h for better quality.
Changed the scene structure to include a BVH tree for improved ray intersection.
Changed the scene initialization parameters for better performance.
Created new Debug functions for ray intersection counting.
Created new functions for triangle collection management in Triangle.c.
Improved pixel updating logic in Window.c.
Improved ray intersection performance with new BVH implementation.
Removed unused includes from Common.h.
Removed old library linking methods in CMakeLists.txt.
2025-04-21 15:56:19 +09:00

56 lines
1.3 KiB
C

#ifndef SCENE_H
#define SCENE_H
#include "Algorithm/BVH.h"
#include "Camera.h"
#include "Lighting/Light.h"
#include "Material/Material.h"
#include "RenderTarget.h"
#include "Geometry/Triangle.h"
typedef struct
{
uint32_t width;
uint32_t height;
uint32_t sample_count;
uint8_t max_depth;
uint32_t bucket_size;
} rendering_config_t;
typedef struct
{
vec3s coord;
uint32_t tile_count_x;
uint32_t tile_count_y;
bool is_init;
bool is_done;
} rendering_context_t;
typedef struct
{
uint32_t x;
uint32_t y;
uint32_t width;
uint32_t height;
} tile_t;
typedef struct
{
camera_t camera;
bvh_tree_t bvh_tree;
triangle_collection_t triangles;
material_collection_t materials;
light_collection_t lights;
} scene_t;
bool scene_init(uint64_t triangle_count, uint8_t material_count, uint32_t punctual_light_count, scene_t* scene);
void scene_free(scene_t* scene);
bool scene_build_bvh(scene_t* scene);
bool scene_render_tile(scene_t* scene, rendering_context_t* ctx, rendering_config_t config, uint32_t tile_index, int rendering_flags, render_target_t* render_target, tile_t* tile_out);
bool scene_render(scene_t* scene, rendering_config_t config, int rendering_flags, render_target_t* render_targetg);
#endif // SCENE_H