Use a light_ prefix for the soft shadows, in consideration for potential future expansions with regards to lights.

This commit is contained in:
nashmuhandes 2024-10-06 22:04:02 +08:00
parent 3750bdd79a
commit 5fd4056750
2 changed files with 6 additions and 5 deletions

View file

@ -57,13 +57,13 @@ thing // ZDRayInfo (ZDRay properties for the map)
thing // Lightmap point light (Light color and distance properties use the same args as dynamic lights) thing // Lightmap point light (Light color and distance properties use the same args as dynamic lights)
{ {
type = 9876; type = 9876;
SoftShadowRadius = <float> (default: 5, radius of the light source in map units; controls the shadow softness. Note that dynamic raytraced lights can also use this feature) light_softshadowradius = <float> (default: 5, radius of the light source in map units; controls the shadow softness. Note that dynamic raytraced lights can also use this feature)
} }
thing // Lightmap spotlight (Light color, distance and angle properties use the same args as dynamic lights) thing // Lightmap spotlight (Light color, distance and angle properties use the same args as dynamic lights)
{ {
type = 9881; type = 9881;
SoftShadowRadius = <float> (default: 5, radius of the light source in map units; controls the shadow softness. Note that dynamic raytraced lights can also use this feature) light_softshadowradius = <float> (default: 5, radius of the light source in map units; controls the shadow softness. Note that dynamic raytraced lights can also use this feature)
} }
linedef linedef

View file

@ -264,6 +264,7 @@ void FLevel::CreateLights()
// UDB's color picker will assign the color as a hex string, stored // UDB's color picker will assign the color as a hex string, stored
// in the arg0str field. detect this, so that it can be converted into an int // in the arg0str field. detect this, so that it can be converted into an int
// this behavior is unique to spotlights.
if (thing->arg0str.Len() > 0) if (thing->arg0str.Len() > 0)
{ {
FString hex = "0x" + thing->arg0str; FString hex = "0x" + thing->arg0str;
@ -282,16 +283,16 @@ void FLevel::CreateLights()
for (const auto& prop : thing->props) for (const auto& prop : thing->props)
{ {
if (!stricmp(prop.key, "softshadowradius")) if (!stricmp(prop.key, "light_softshadowradius"))
{ {
softshadowradius = atof(prop.value); softshadowradius = atof(prop.value);
} }
} }
// this is known as "intensity" on dynamic lights (and in UDB) // this is known as "intensity" on dynamic lights (and in UDB) - what it actually is though, is the radius
lightDistance = thing->args[3]; lightDistance = thing->args[3];
// lightmap light intensity (not to be confused with dynamic lights' intensity, which is actually lightmap light distance // light intensity is how bright or dark a light is. can go below or above 1.0.
lightIntensity = thing->alpha; lightIntensity = thing->alpha;
if (lightDistance > 0.0f && lightIntensity > 0.0f && lightColor != FVector3(0, 0, 0)) if (lightDistance > 0.0f && lightIntensity > 0.0f && lightColor != FVector3(0, 0, 0))