2021-03-28 13:56:46 -07:00
|
|
|
#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;
|
2021-06-05 12:48:16 -07:00
|
|
|
} vk_emissive_texture_t;
|
2021-03-28 13:56:46 -07:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint8_t num_dlights;
|
2021-04-16 11:43:37 -07:00
|
|
|
uint8_t num_emissive_surfaces;
|
2021-03-28 13:56:46 -07:00
|
|
|
uint8_t dlights[MAX_VISIBLE_DLIGHTS];
|
2021-04-16 11:43:37 -07:00
|
|
|
uint8_t emissive_surfaces[MAX_VISIBLE_SURFACE_LIGHTS];
|
2021-06-05 12:48:16 -07:00
|
|
|
} vk_lights_cell_t;
|
2021-03-28 13:56:46 -07:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
vec3_t emissive;
|
2021-06-05 12:48:16 -07:00
|
|
|
uint32_t kusok_index;
|
|
|
|
matrix3x4 transform;
|
2021-03-28 13:56:46 -07:00
|
|
|
} vk_emissive_surface_t;
|
|
|
|
|
|
|
|
typedef struct {
|
2021-04-12 11:07:41 -07:00
|
|
|
struct {
|
2021-06-05 12:48:16 -07:00
|
|
|
int grid_min_cell[3];
|
|
|
|
int grid_size[3];
|
|
|
|
int grid_cells;
|
|
|
|
|
|
|
|
vk_emissive_texture_t emissive_textures[MAX_TEXTURES];
|
|
|
|
} map;
|
2021-04-16 11:43:37 -07:00
|
|
|
|
2021-06-05 12:48:16 -07:00
|
|
|
int num_emissive_surfaces;
|
|
|
|
vk_emissive_surface_t emissive_surfaces[255]; // indexed by uint8_t
|
2021-04-16 11:43:37 -07:00
|
|
|
|
2021-06-05 12:48:16 -07:00
|
|
|
vk_lights_cell_t cells[MAX_LIGHT_CLUSTERS];
|
|
|
|
} vk_lights_t;
|
2021-03-28 13:56:46 -07:00
|
|
|
|
2021-06-05 12:48:16 -07:00
|
|
|
extern vk_lights_t g_lights;
|
2021-03-28 13:56:46 -07:00
|
|
|
|
|
|
|
void VK_LightsShutdown( void );
|
2021-06-05 12:48:16 -07:00
|
|
|
|
|
|
|
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 );
|