diff --git a/include/light/light.hh b/include/light/light.hh index e8906a90..80934f6a 100644 --- a/include/light/light.hh +++ b/include/light/light.hh @@ -45,6 +45,9 @@ #define ANGLE_EPSILON 0.001f #define EQUAL_EPSILON 0.001f +// FIXME: use maximum dimension of level +#define MAX_SKY_DIST 1000000.0f + typedef struct { vec3_t color; vec3_t direction; diff --git a/light/ltface.cc b/light/ltface.cc index 4d917d25..632b4bd3 100644 --- a/light/ltface.cc +++ b/light/ltface.cc @@ -1530,7 +1530,6 @@ static void LightFace_Sky(const sun_t *sun, const lightsurf_t *lightsurf, lightmapdict_t *lightmaps) { const globalconfig_t &cfg = *lightsurf->cfg; - const float MAX_SKY_DIST = 65536.0f; const modelinfo_t *modelinfo = lightsurf->modelinfo; const plane_t *plane = &lightsurf->plane; diff --git a/light/trace_embree.cc b/light/trace_embree.cc index 6a0a324f..996f8107 100644 --- a/light/trace_embree.cc +++ b/light/trace_embree.cc @@ -37,8 +37,6 @@ using namespace std; using namespace polylib; -static const float MAX_SKY_RAY_DEPTH = 8192.0f; - class sceneinfo { public: unsigned geomID; @@ -754,7 +752,7 @@ qboolean Embree_TestSky(const vec3_t start, const vec3_t dirn, const modelinfo_t VectorCopy(dirn, dir_normalized); VectorNormalize(dir_normalized); - RTCRay ray = SetupRay(0, start, dir_normalized, MAX_SKY_RAY_DEPTH, self); + RTCRay ray = SetupRay(0, start, dir_normalized, MAX_SKY_DIST, self); rtcIntersect(scene, ray); qboolean hit_sky = (ray.geomID == skygeom.geomID);