Enhance graphics library functionality and structure
Added new function signatures in `assimp-vc143-mt.lib` for improved logging, parsing, and vector operations. Added new metadata and configuration information in `assimp-vc143-mt.dll` for versioning and licensing compliance. Added Sobol sequence generation in `Sobol.c` for quasi-random sampling. Added window message handling in `Window.c` for rendering graphics. Added ray-triangle intersection tests in `RayIntersection.c` for collision detection. Added functions for loading mesh data in `Mesh.c` to support 3D model import. Added functions for managing triangle collections in `Triangle.c` to enhance geometric data handling. Added light evaluation functions in `LightEvaluation.c` and `SkyLight.c` for realistic rendering. Added sampling and evaluation functions for simple lit materials in `SimpleLit.c`. Changed various header files to include copyright and licensing information. Changed existing functions in multiple files to improve performance and clarity. Removed unused code in several files to streamline the library.
This commit is contained in:
24
header/Rendering/PostProcessing.h
Normal file
24
header/Rendering/PostProcessing.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef POST_PROCESSING_H
|
||||
#define POST_PROCESSING_H
|
||||
|
||||
#include "cglm/struct/vec4.h"
|
||||
#include "cglm/struct/mat4.h"
|
||||
|
||||
// Maybe full aces later
|
||||
inline vec4s aces_tone_map(const vec4s color)
|
||||
{
|
||||
vec4s mapped_color = color;
|
||||
float a = 2.51f;
|
||||
float b = 0.03f;
|
||||
float c = 2.43f;
|
||||
float d = 0.59f;
|
||||
float e = 0.14f;
|
||||
|
||||
mapped_color.x = (color.x * (a * color.x + b)) / (color.x * (c * color.x + d) + e);
|
||||
mapped_color.y = (color.y * (a * color.y + b)) / (color.y * (c * color.y + d) + e);
|
||||
mapped_color.z = (color.z * (a * color.z + b)) / (color.z * (c * color.z + d) + e);
|
||||
|
||||
return mapped_color;
|
||||
}
|
||||
|
||||
#endif // POST_PROCESSING_H
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef RENDERTARGET_H
|
||||
#define RENDERTARGET_H
|
||||
|
||||
#include "cglm/types-struct.h"
|
||||
#include "Common.h"
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct
|
||||
@@ -14,6 +14,7 @@ typedef struct
|
||||
render_target_t render_target_create(uint32_t width, uint32_t height);
|
||||
vec4s render_target_get_pixel(render_target_t* render_target, uint32_t x, uint32_t y);
|
||||
void render_target_set_pixel(render_target_t* render_target, uint32_t x, uint32_t y, vec4s color);
|
||||
unsigned char* render_target_to_char(render_target_t* render_target);
|
||||
void render_target_free(render_target_t* target);
|
||||
|
||||
#endif // RENDERTARGET_H
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
#define SCENE_H
|
||||
|
||||
#include "Camera.h"
|
||||
#include "Lighting/Light.h"
|
||||
#include "Material/Material.h"
|
||||
#include "RenderTarget.h"
|
||||
#include "Material.h"
|
||||
#include "Triangle.h"
|
||||
#include "Geometry/Triangle.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -13,18 +14,38 @@ typedef struct
|
||||
uint32_t sample_count;
|
||||
uint8_t max_depth;
|
||||
|
||||
uint32_t tile_size;
|
||||
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;
|
||||
triangle_collection_t triangles;
|
||||
material_collection_t materials;
|
||||
light_collection_t lights;
|
||||
} scene_t;
|
||||
|
||||
scene_t scene_create(uint64_t triangle_count, uint8_t material_count);
|
||||
render_target_t scene_render(scene_t* scene, rendering_config_t config);
|
||||
scene_t scene_create(const uint64_t triangle_count, const uint8_t material_count, const uint32_t max_punctual_lights);
|
||||
bool scene_render_tile(scene_t* scene, rendering_context_t* ctx, render_target_t* render_target,
|
||||
const rendering_config_t config, const uint32_t tile_index, tile_t* tile_out);
|
||||
render_target_t scene_render(scene_t* scene, const rendering_config_t config);
|
||||
void scene_free(scene_t* scene);
|
||||
|
||||
#endif // SCENE_H
|
||||
|
||||
Reference in New Issue
Block a user