mirror of
https://github.com/ZDoom/ZDRay.git
synced 2025-01-24 16:51:08 +00:00
Replace Thing UDMF keys for the ZDRayInfo with args instead
This commit is contained in:
parent
05eed4d4a2
commit
25345c2477
2 changed files with 18 additions and 31 deletions
|
@ -52,10 +52,6 @@ Usage: zdray [options] sourcefile.wad
|
||||||
thing // ZDRayInfo (ZDRay properties for the map)
|
thing // ZDRayInfo (ZDRay properties for the map)
|
||||||
{
|
{
|
||||||
type = 9890;
|
type = 9890;
|
||||||
suncolor = <int> (color)
|
|
||||||
sampledistance = <int> (default: 8, map units each lightmap texel covers, must be in powers of two)
|
|
||||||
bounces = <int> (default: 1, how many times light bounces off walls)
|
|
||||||
gridsize = <float> (default: 32, grid density for the automatic light probes)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
thing // Static point light (Light color and distance properties use the same args as dynamic lights)
|
thing // Static point light (Light color and distance properties use the same args as dynamic lights)
|
||||||
|
|
|
@ -113,33 +113,24 @@ void FLevel::SetupLights()
|
||||||
sundir.z = -sdz;
|
sundir.z = -sdz;
|
||||||
//printf("sun vector: %f, %f, %f\n", sundir.x, sundir.y, sundir.z);
|
//printf("sun vector: %f, %f, %f\n", sundir.x, sundir.y, sundir.z);
|
||||||
|
|
||||||
for (unsigned int propIndex = 0; propIndex < thing->props.Size(); propIndex++)
|
// sun color
|
||||||
{
|
lightcolor = thing->args[0];
|
||||||
const UDMFKey& key = thing->props[propIndex];
|
|
||||||
if (!stricmp(key.key, "suncolor"))
|
// sample distance
|
||||||
{
|
Samples = thing->args[1];
|
||||||
lightcolor = atoi(key.value);
|
if (Samples <= 0) Samples = 1;
|
||||||
}
|
if (Samples > 128) Samples = 128;
|
||||||
else if (!stricmp(key.key, "sampledistance"))
|
Samples = Math::RoundPowerOfTwo(Samples);
|
||||||
{
|
|
||||||
Samples = atoi(key.value);
|
// number of light bounces
|
||||||
if (Samples <= 0) Samples = 1;
|
LightBounce = thing->args[2];
|
||||||
if (Samples > 128) Samples = 128;
|
if (LightBounce < 0) LightBounce = 0;
|
||||||
Samples = Math::RoundPowerOfTwo(Samples);
|
if (LightBounce > 8) LightBounce = 8;
|
||||||
}
|
|
||||||
else if (!stricmp(key.key, "bounces"))
|
// auto probe grid size
|
||||||
{
|
GridSize = thing->args[3];
|
||||||
LightBounce = atoi(key.value);
|
if (GridSize < 0.f) GridSize = 0.f;
|
||||||
if (LightBounce < 0) LightBounce = 0;
|
if (GridSize > 1024.f) GridSize = 1024.f;
|
||||||
if (LightBounce > 8) LightBounce = 8;
|
|
||||||
}
|
|
||||||
else if (!stricmp(key.key, "gridsize"))
|
|
||||||
{
|
|
||||||
GridSize = atof(key.value);
|
|
||||||
if (GridSize < 0.f) GridSize = 0.f;
|
|
||||||
if (GridSize > 1024.f) GridSize = 1024.f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dot(sundir, sundir) > 0.01f)
|
if (dot(sundir, sundir) > 0.01f)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue