Skip to content

Commit

Permalink
Add some jitter to sun sampling to antialias shadows.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdolan committed Feb 17, 2024
1 parent 4e0c9e0 commit 787d994
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/quemap/lightmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static void LightmapLuxel_Sun(light_t *light, const lightmap_t *lightmap, luxel_

for (int32_t i = 0; i < light->num_points; i++) {

const vec3_t dir = Vec3_Negate(light->points[i]);
const vec3_t dir = Vec3_Add(Vec3_Negate(light->points[i]), Vec3_RandomRange(-0.005f, +0.005f));
const vec3_t end = Vec3_Fmaf(luxel->origin, MAX_WORLD_DIST, dir);

const cm_trace_t trace = Light_Trace(luxel->origin, end, lightmap->model->head_node, CONTENTS_SOLID);
Expand Down

0 comments on commit 787d994

Please sign in to comment.