2023-05-09 13:04:14 +02:00
|
|
|
#ifndef DF_RAYTRACING_H
|
|
|
|
#define DF_RAYTRACING_H
|
|
|
|
|
2023-05-23 13:20:59 +02:00
|
|
|
#include "image.h"
|
|
|
|
|
2023-05-09 13:04:14 +02:00
|
|
|
/** @brief Stores information for rays in a SIMD friendly way */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/** Packs all SIMD data into a single buffer */
|
|
|
|
float *simd_mem;
|
|
|
|
|
|
|
|
/** Source uvs for rays */
|
|
|
|
df_v2 *ray_uvs;
|
|
|
|
|
|
|
|
/* Points into simd_mem */
|
|
|
|
float *base_x;
|
|
|
|
float *base_y;
|
|
|
|
float *base_z;
|
|
|
|
float *dir_x;
|
|
|
|
float *dir_y;
|
|
|
|
float *dir_z;
|
|
|
|
|
|
|
|
size_t ray_count;
|
|
|
|
} df_ray_packet;
|
|
|
|
|
|
|
|
/** @brief Free ray packet memory */
|
|
|
|
DF_API void df_release_ray_packet(df_ray_packet *rays);
|
|
|
|
|
2023-05-23 13:20:59 +02:00
|
|
|
DF_API void df_evaluate_ray_packet(const df_ray_packet *rays, df_image *output);
|
2023-05-09 13:04:14 +02:00
|
|
|
|
|
|
|
#endif
|