vk: restore dynamic polygon lights

This commit is contained in:
Ivan Avdeev 2023-08-29 13:39:36 -04:00
parent 0ccc107859
commit ea1a98716d
5 changed files with 11 additions and 11 deletions

View File

@ -1118,7 +1118,7 @@ void R_VkBrushModelCollectEmissiveSurfaces( const struct model_s *mod, qboolean
continue;
}
//DEBUG("%d: i=%d surf_index=%d patch=%d(%#x) => emissive=(%f,%f,%f)", emissive_surfaces_count, i, surface_index, !!psurf, psurf?psurf->flags:0, emissive[0], emissive[1], emissive[2]);
DEBUG("%d: i=%d surf_index=%d tex_id=%d patch=%d(%#x) => emissive=(%f,%f,%f)", emissive_surfaces_count, i, surface_index, tex_id, !!psurf, psurf?psurf->flags:0, emissive[0], emissive[1], emissive[2]);
if (emissive_surfaces_count == MAX_SURFACE_LIGHTS) {
ERR("Too many emissive surfaces for model %s: max=%d", mod->name, MAX_SURFACE_LIGHTS);

View File

@ -264,6 +264,8 @@ static qboolean loadRadData( const model_t *map, const char *fmt, ... ) {
// See DIRECT_SCALE in qrad/lightmap.c
VectorScale(etex->emissive, 0.1f, etex->emissive);
DEBUG(" texture(%s?, %d) set emissive(%f, %f, %f)", texture_name, tex_id, etex->emissive[0], etex->emissive[1], etex->emissive[2]);
if (!enabled)
DEBUG("rad entry %s disabled due to zero intensity", name);
}

View File

@ -284,20 +284,13 @@ void RT_FrameAddModel( struct rt_model_s *model, rt_frame_add_model_t args ) {
}
}
#if 0
// TODO needed for brush models only
// (? TODO studio models?)
for (int i = 0; i < render_model->dynamic_polylights_count; ++i) {
rt_light_add_polygon_t *const polylight = render_model->dynamic_polylights + i;
polylight->transform_row = (const matrix3x4*)render_model->deprecate.transform;
for (int i = 0; i < args.dynamic_polylights_count; ++i) {
rt_light_add_polygon_t *const polylight = args.dynamic_polylights + i;
polylight->transform_row = (const matrix3x4*)args.transform;
polylight->dynamic = true;
RT_LightAddPolygon(polylight);
}
/* FIXME move to RT_FrameAddModel if (!uploadKusochkiSubset(model, render_model, render_model->geometries_changed, render_model->geometries_changed_count)) */
/* return; */
#endif
rt_draw_instance_t *const draw_instance = getDrawInstance();
if (!draw_instance)
return;

View File

@ -775,6 +775,8 @@ void R_RenderModelDraw(const vk_render_model_t *model, r_model_draw_t args) {
.transform = (const matrix3x4*)args.transform,
.prev_transform = (const matrix3x4*)args.prev_transform,
.color = args.color,
.dynamic_polylights = model->dynamic_polylights,
.dynamic_polylights_count = model->dynamic_polylights_count,
.override = {
.textures = args.textures_override,
.geoms = model->geometries,

View File

@ -57,6 +57,9 @@ typedef struct {
const matrix3x4 *transform, *prev_transform;
const vec4_t *color;
struct rt_light_add_polygon_s *dynamic_polylights;
int dynamic_polylights_count;
struct {
int textures; // Override kusochki/material textures if > 0