Files
SimpleRayTracing/header/Rendering/Renderer.h
Misaki 0061609267 Refactor path tracing and material rendering system
Added a new enum `path_state` and a struct `path_output` in `Common.h` to manage path tracing states and outputs.
Added a new `simple_lit_render_loop` function in `SimpleLit.c` to handle rendering for simple lit materials, integrating light contributions and BSDF evaluations.

Changed the function signatures in `Light.h` to use `path_output` instead of `vec3s` for BSDF evaluations.
Changed the `evaluate_bsdf_directional` function in `LightEvaluation.h` to return `path_output` instead of `vec3s`.
Changed the `evaluate_bsdf_sky` function in `LightEvaluation.h` to return `path_output` and updated its implementation accordingly.
Changed the function signature of `evaluate_bsdf_const_sky` in `SkyLight.h` to return `path_output` and modified its implementation to match.

Removed several old BSDF-related functions in `Material.c` that are no longer needed due to the new structure.

Updated the `material_create` function in `Material.c` to accept the new render loop function pointer.
Updated the `path_trace` function in `PathTracing.c` to utilize the new `path_output` structure for managing light contributions and state transitions during path tracing.
Updated the `evaluate_bsdf_directional` function in `LightEvaluation.c` to return `path_output` and adjusted its internal logic to populate the output structure.
Updated the `evaluate_bsdf_const_sky` function in `SkyLight.c` to return `path_output` and modified its logic to handle light contributions correctly.
Updated the intensity of the sky light to `0.0f` during scene setup in `main.c`, effectively disabling it.
2025-05-01 01:21:48 +09:00

37 lines
608 B
C

#ifndef RENDERER_H
#define RENDERER_H
#include "Rendering/Debug.h"
#include "Rendering/Scene.h"
typedef enum
{
PROGRESSIVE = 0,
TILE_BASED = 1,
} rendering_mode_t;
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
{
scene_t* scene;
render_target_t* render_target;
const rendering_config_t* config;
rendering_mode_t rendering_type;
debug_flag_t debug_flag;
bool is_done;
} render_job_t;
void renderer_start(render_job_t* job);
#endif // RENDERER_H