From 3750bdd79ac8b72addd18509c1148149dde1f98e Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Sat, 15 Jun 2024 18:08:20 +0800 Subject: [PATCH] Rename SourceRadius to SoftShadowRadius --- README.md | 4 ++-- src/level/doomdata.h | 2 +- src/level/level_light.cpp | 8 ++++---- src/lightmapper/doom_levelmesh.cpp | 2 +- src/lightmapper/glsl/binding_lightmapper.glsl.h | 2 +- src/lightmapper/glsl/binding_viewer.glsl.h | 2 +- src/lightmapper/glsl/trace_light.glsl.h | 4 ++-- src/lightmapper/hw_levelmeshlight.h | 2 +- src/lightmapper/vk_levelmesh.cpp | 2 +- src/lightmapper/vk_levelmesh.h | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index ad64b5b..f5e6ae8 100644 --- a/README.md +++ b/README.md @@ -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) { type = 9876; - sourceradius = <float> (default: 5, radius of the light source in map units; controls the softness) + 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) { type = 9881; - SourceRadius = <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) + 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 diff --git a/src/level/doomdata.h b/src/level/doomdata.h index 1f4f2a5..542cc04 100644 --- a/src/level/doomdata.h +++ b/src/level/doomdata.h @@ -432,7 +432,7 @@ struct ThingLight float outerAngleCos; float height; float radius; - float sourceRadius; + float softShadowRadius; bool bCeiling; IntSector *sector; MapSubsectorEx *ssect; diff --git a/src/level/level_light.cpp b/src/level/level_light.cpp index 8a37e89..3a4072f 100644 --- a/src/level/level_light.cpp +++ b/src/level/level_light.cpp @@ -247,7 +247,7 @@ void FLevel::CreateLights() float lightDistance = 0.0f; float innerAngleCos = -1.0f; float outerAngleCos = -1.0f; - float sourceradius = 5.0f; + float softshadowradius = 5.0f; // need to process point lights and spot lights differently due to their // inconsistent arg usage... @@ -282,9 +282,9 @@ void FLevel::CreateLights() for (const auto& prop : thing->props) { - if (!stricmp(prop.key, "sourceradius")) + if (!stricmp(prop.key, "softshadowradius")) { - sourceradius = atof(prop.value); + softshadowradius = atof(prop.value); } } @@ -313,7 +313,7 @@ void FLevel::CreateLights() thingLight.origin.X = x; thingLight.origin.Y = y; thingLight.sectorGroup = thingLight.sector->group; - thingLight.sourceRadius = sourceradius; + thingLight.softShadowRadius = softshadowradius; ThingLights.Push(thingLight); } diff --git a/src/lightmapper/doom_levelmesh.cpp b/src/lightmapper/doom_levelmesh.cpp index 56adeda..b6cb282 100644 --- a/src/lightmapper/doom_levelmesh.cpp +++ b/src/lightmapper/doom_levelmesh.cpp @@ -148,7 +148,7 @@ int DoomLevelMesh::GetLightIndex(ThingLight* light, int portalgroup) meshlight.OuterAngleCos = light->outerAngleCos; meshlight.SpotDir = light->SpotDir(); meshlight.Color = light->rgb; - meshlight.SourceRadius = light->sourceRadius; + meshlight.SoftShadowRadius = light->softShadowRadius; meshlight.SectorGroup = 0; // if (light->sector) diff --git a/src/lightmapper/glsl/binding_lightmapper.glsl.h b/src/lightmapper/glsl/binding_lightmapper.glsl.h index 5716c7f..87f12a0 100644 --- a/src/lightmapper/glsl/binding_lightmapper.glsl.h +++ b/src/lightmapper/glsl/binding_lightmapper.glsl.h @@ -38,7 +38,7 @@ struct LightInfo float InnerAngleCos; float OuterAngleCos; vec3 SpotDir; - float SourceRadius; + float SoftShadowRadius; vec3 Color; float Padding3; }; diff --git a/src/lightmapper/glsl/binding_viewer.glsl.h b/src/lightmapper/glsl/binding_viewer.glsl.h index 5b9433b..e752c61 100644 --- a/src/lightmapper/glsl/binding_viewer.glsl.h +++ b/src/lightmapper/glsl/binding_viewer.glsl.h @@ -30,7 +30,7 @@ struct LightInfo float InnerAngleCos; float OuterAngleCos; vec3 SpotDir; - float SourceRadius; + float SoftShadowRadius; vec3 Color; float Padding3; }; diff --git a/src/lightmapper/glsl/trace_light.glsl.h b/src/lightmapper/glsl/trace_light.glsl.h index 3e00665..2cf41d9 100644 --- a/src/lightmapper/glsl/trace_light.glsl.h +++ b/src/lightmapper/glsl/trace_light.glsl.h @@ -30,13 +30,13 @@ vec3 TraceLight(vec3 origin, vec3 normal, LightInfo light, float extraDistance) #if defined(USE_SOFTSHADOWS) - if (light.SourceRadius != 0.0) + if (light.SoftShadowRadius != 0.0) { vec3 v = (abs(dir.x) > abs(dir.y)) ? vec3(0.0, 1.0, 0.0) : vec3(1.0, 0.0, 0.0); vec3 xdir = normalize(cross(dir, v)); vec3 ydir = cross(dir, xdir); - float lightsize = light.SourceRadius; + float lightsize = light.SoftShadowRadius; int step_count = 10; for (int i = 0; i < step_count; i++) { diff --git a/src/lightmapper/hw_levelmeshlight.h b/src/lightmapper/hw_levelmeshlight.h index 82ebf92..e8a8132 100644 --- a/src/lightmapper/hw_levelmeshlight.h +++ b/src/lightmapper/hw_levelmeshlight.h @@ -15,5 +15,5 @@ public: FVector3 SpotDir; FVector3 Color; int SectorGroup; - float SourceRadius; + float SoftShadowRadius; }; diff --git a/src/lightmapper/vk_levelmesh.cpp b/src/lightmapper/vk_levelmesh.cpp index e894253..14c3ac3 100644 --- a/src/lightmapper/vk_levelmesh.cpp +++ b/src/lightmapper/vk_levelmesh.cpp @@ -670,7 +670,7 @@ void VkLevelMeshUploader::UploadLights() info.OuterAngleCos = light.OuterAngleCos; info.SpotDir = SwapYZ(light.SpotDir); info.Color = light.Color; - info.SourceRadius = light.SourceRadius; + info.SoftShadowRadius = light.SoftShadowRadius; *(lights++) = info; } diff --git a/src/lightmapper/vk_levelmesh.h b/src/lightmapper/vk_levelmesh.h index 5a74441..fd32742 100644 --- a/src/lightmapper/vk_levelmesh.h +++ b/src/lightmapper/vk_levelmesh.h @@ -57,7 +57,7 @@ struct LightInfo float InnerAngleCos; float OuterAngleCos; FVector3 SpotDir; - float SourceRadius; + float SoftShadowRadius; FVector3 Color; float Padding3; };