xash3d-fwgs/ref_vk/vk_light.h
Ivan 'provod' Avdeev 00518d3251 rtx: implement dynamic lights
track brush models movement and update lights grid clusters with model transform and stuff

also implement animated textures for rtx

and also increase per-cluster lights limits
2021-06-05 12:48:16 -07:00

55 lines
1.1 KiB
C

#pragma once
#include "vk_const.h"
#include "xash3d_types.h"
#include "protocol.h"
#include "const.h"
#include "bspfile.h"
typedef struct {
vec3_t emissive;
qboolean set;
} vk_emissive_texture_t;
typedef struct {
uint8_t num_dlights;
uint8_t num_emissive_surfaces;
uint8_t dlights[MAX_VISIBLE_DLIGHTS];
uint8_t emissive_surfaces[MAX_VISIBLE_SURFACE_LIGHTS];
} vk_lights_cell_t;
typedef struct {
vec3_t emissive;
uint32_t kusok_index;
matrix3x4 transform;
} vk_emissive_surface_t;
typedef struct {
struct {
int grid_min_cell[3];
int grid_size[3];
int grid_cells;
vk_emissive_texture_t emissive_textures[MAX_TEXTURES];
} map;
int num_emissive_surfaces;
vk_emissive_surface_t emissive_surfaces[255]; // indexed by uint8_t
vk_lights_cell_t cells[MAX_LIGHT_CLUSTERS];
} vk_lights_t;
extern vk_lights_t g_lights;
void VK_LightsShutdown( void );
void VK_LightsNewMap( void );
void VK_LightsFrameInit( void );
struct vk_render_model_s;
void VK_LightsAddEmissiveSurfacesFromModel( const struct vk_render_model_s *model, const matrix3x4 *transform_row);
void VK_LightsFrameFinalize( void );