#ifndef AOV_H #define AOV_H #include "cglm/struct/vec4.h" #define MAX_AOV_TARGET 5 typedef enum { AOV_BEAUTY = 1 << 0, AOV_AlBEDO = 1 << 1, AOV_NORMAL = 1 << 2, AOV_DEPTH = 1 << 3, AOV_POSITION = 1 << 4, } aov_flags_t; typedef enum { AOV_BEAUTY_INDEX = 0, AOV_AlBEDO_INDEX = 1, AOV_NORMAL_INDEX = 2, AOV_DEPTH_INDEX = 3, AOV_POSITION_INDEX = 4, } aov_index_t; typedef struct { vec4s beauty; vec4s albedo; vec4s normal; vec4s position; float depth; } aov_output_t; inline void accumulate_aov(aov_output_t* aov, const aov_output_t* new_aov, float inv_sample_count) { aov->beauty = glms_vec4_add(aov->beauty, glms_vec4_scale(new_aov->beauty, inv_sample_count)); aov->albedo = glms_vec4_add(aov->albedo, glms_vec4_scale(new_aov->albedo, inv_sample_count)); aov->normal = glms_vec4_add(aov->normal, glms_vec4_scale(new_aov->normal, inv_sample_count)); aov->position = glms_vec4_add(aov->position, glms_vec4_scale(new_aov->position, inv_sample_count)); aov->depth = fminf(aov->depth, new_aov->depth); } #endif // AOV_H