light: hack for sky + LIGHTGRID lump

just sample the sunlight omnidirectionally
This commit is contained in:
Eric Wasylishen 2023-02-05 23:09:05 -07:00
parent 712f413ac8
commit af2e8ae404
1 changed files with 13 additions and 7 deletions

View File

@ -1939,17 +1939,23 @@ LightPoint_SurfaceLight(const mbsp_t *bsp, raystream_occlusion_t &rs, const std:
qvec3f indirect{};
for (int axis = 0; axis < 3; ++axis) {
for (int sign = -1; sign <= +1; sign += 2) {
if (vpl.omnidirectional) {
// HACK: receive light omnidirectionally
indirect = GetSurfaceLighting(cfg, &vpl, dir, dist, {0, 0, 0}, false, standard_scale, sky_scale, hotspot_clamp);
} else {
for (int axis = 0; axis < 3; ++axis) {
for (int sign = -1; sign <= +1; sign += 2) {
qvec3f cube_color;
qvec3f cube_color;
qvec3f cube_normal{};
cube_normal[axis] = sign;
qvec3f cube_normal{};
cube_normal[axis] = sign;
cube_color = GetSurfaceLighting(cfg, &vpl, dir, dist, cube_normal, true, standard_scale, sky_scale, hotspot_clamp);
cube_color = GetSurfaceLighting(
cfg, &vpl, dir, dist, cube_normal, true, standard_scale, sky_scale, hotspot_clamp);
indirect += cube_color / 6.0;
indirect += cube_color / 6.0;
}
}
}