From 3d193545140a5fb1f5aeada8a45e0e07cd4236a0 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 9 Aug 2016 23:31:48 -0600 Subject: [PATCH] light: EstimateVisibleBoundsAtPoint: increase to 1024 samples to fix lightstest1.map. remove randomness. only expand AABB by 1% down from 10%, since using 1024 samples now, bbox will be closer to the actual one. --- light/entities.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/light/entities.cc b/light/entities.cc index 0773eff8..9088dec6 100644 --- a/light/entities.cc +++ b/light/entities.cc @@ -1015,7 +1015,7 @@ FixLightsOnFaces(const bsp2_t *bsp) void EstimateVisibleBoundsAtPoint(const vec3_t point, vec3_t mins, vec3_t maxs) { - const int N = 16; + const int N = 32; const int N2 = N*N; raystream_t *rs = MakeRayStream(N2); @@ -1023,12 +1023,11 @@ void EstimateVisibleBoundsAtPoint(const vec3_t point, vec3_t mins, vec3_t maxs) AABB_Init(mins, maxs, point); for (int x=0; x(x + Random()) / static_cast(N); - const vec_t u2 = static_cast(y + Random()) / static_cast(N); + const vec_t u1 = static_cast(x) / static_cast(N - 1); + const vec_t u2 = static_cast(y) / static_cast(N - 1); vec3_t dir; UniformPointOnSphere(dir, u1, u2); - //RandomDir(dir); rs->pushRay(0, point, dir, 65536.0f, nullptr); } @@ -1048,10 +1047,10 @@ void EstimateVisibleBoundsAtPoint(const vec3_t point, vec3_t mins, vec3_t maxs) AABB_Expand(mins, maxs, stop); } - // grow it by 10% in each direction + // grow it by 1% in each direction vec3_t size; AABB_Size(mins, maxs, size); - VectorScale(size, 0.10, size); + VectorScale(size, 0.01, size); AABB_Grow(mins, maxs, size); /*