light: increase max sky distance to 1M

This commit is contained in:
Eric Wasylishen 2019-04-20 12:27:27 -06:00
parent b343b9504a
commit ba7bdf86a1
3 changed files with 4 additions and 4 deletions

View File

@ -45,6 +45,9 @@
#define ANGLE_EPSILON 0.001f #define ANGLE_EPSILON 0.001f
#define EQUAL_EPSILON 0.001f #define EQUAL_EPSILON 0.001f
// FIXME: use maximum dimension of level
#define MAX_SKY_DIST 1000000.0f
typedef struct { typedef struct {
vec3_t color; vec3_t color;
vec3_t direction; vec3_t direction;

View File

@ -1530,7 +1530,6 @@ static void
LightFace_Sky(const sun_t *sun, const lightsurf_t *lightsurf, lightmapdict_t *lightmaps) LightFace_Sky(const sun_t *sun, const lightsurf_t *lightsurf, lightmapdict_t *lightmaps)
{ {
const globalconfig_t &cfg = *lightsurf->cfg; const globalconfig_t &cfg = *lightsurf->cfg;
const float MAX_SKY_DIST = 65536.0f;
const modelinfo_t *modelinfo = lightsurf->modelinfo; const modelinfo_t *modelinfo = lightsurf->modelinfo;
const plane_t *plane = &lightsurf->plane; const plane_t *plane = &lightsurf->plane;

View File

@ -37,8 +37,6 @@
using namespace std; using namespace std;
using namespace polylib; using namespace polylib;
static const float MAX_SKY_RAY_DEPTH = 8192.0f;
class sceneinfo { class sceneinfo {
public: public:
unsigned geomID; unsigned geomID;
@ -754,7 +752,7 @@ qboolean Embree_TestSky(const vec3_t start, const vec3_t dirn, const modelinfo_t
VectorCopy(dirn, dir_normalized); VectorCopy(dirn, dir_normalized);
VectorNormalize(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); rtcIntersect(scene, ray);
qboolean hit_sky = (ray.geomID == skygeom.geomID); qboolean hit_sky = (ray.geomID == skygeom.geomID);