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:
@@ -7,11 +7,18 @@
|
||||
#include "Material/Material.h"
|
||||
#include "cglm/struct/vec3.h"
|
||||
|
||||
#define SKY_DATA_CAPACITY 64
|
||||
|
||||
typedef enum {
|
||||
SKY_TYPE_CONSTANT,
|
||||
} sky_type_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3s normal;
|
||||
vec3s hit_point;
|
||||
vec3s wo;
|
||||
vec2s uv;
|
||||
|
||||
uint16_t bounce_depth;
|
||||
|
||||
@@ -19,12 +26,22 @@ typedef struct
|
||||
const material_t* material;
|
||||
} light_shading_context_t;
|
||||
|
||||
#ifdef __STDC_ALIGN__
|
||||
#define SKY_ALIGN _Alignof(max_align_t)
|
||||
#else
|
||||
#define SKY_ALIGN (sizeof(void*))
|
||||
#endif
|
||||
|
||||
typedef vec3s (*evaluate_bsdf_sky_f) (const void* data, const light_shading_context_t* context, vec3s throughput, uint32_t index);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
evaluate_bsdf_sky_f evaluate_bsdf_sky;
|
||||
const void* data;
|
||||
sky_type_t type;
|
||||
uint16_t data_size;
|
||||
|
||||
_Alignas(SKY_ALIGN)
|
||||
char data[SKY_DATA_CAPACITY];
|
||||
} sky_light_t;
|
||||
|
||||
typedef enum
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define SKY_LIGHT_H
|
||||
|
||||
#include "Light.h"
|
||||
#include <string.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -13,10 +14,14 @@ vec3s evaluate_bsdf_const_sky(const void* data, const light_shading_context_t* c
|
||||
|
||||
inline sky_light_t sky_create_constant_sky(const constant_sky_data_t* data)
|
||||
{
|
||||
return (sky_light_t){
|
||||
sky_light_t light = {
|
||||
.evaluate_bsdf_sky = evaluate_bsdf_const_sky,
|
||||
.data = data,
|
||||
.type = SKY_TYPE_CONSTANT,
|
||||
.data_size = sizeof(constant_sky_data_t),
|
||||
};
|
||||
|
||||
memcpy(light.data, data, sizeof(constant_sky_data_t));
|
||||
return light;
|
||||
}
|
||||
|
||||
#endif // SKY_LIGHT_H
|
||||
|
||||
Reference in New Issue
Block a user