17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-08 22:07:20 +01:00

Add the optional Radius, ShadeSelf, CastShadows and SoftFalloff of FreeSpotLight and make FalloffAngle 360 a point light

This commit is contained in:
2026-10-28 16:18:03 +01:00
parent 413cebed9c
commit c4e23932bf
25 changed files with 327 additions and 72 deletions

View File

@@ -402,6 +402,10 @@ void gfx::local_lights::add_light_point(TSubModel const &Submodel, glm::mat4 con
lightpoint.cos_outer = std::clamp(Submodel.fCosFalloffAngle, -1.f, 0.999f);
lightpoint.cos_inner = std::clamp(std::max(Submodel.fCosHotspotAngle, lightpoint.cos_outer + 0.05f), lightpoint.cos_outer + 0.001f, 1.f);
lightpoint.range = light_range(color);
lightpoint.radius = Submodel.fLightRadius;
lightpoint.soft_falloff = Submodel.bSoftFalloff;
lightpoint.cast_shadows = Submodel.bCastShadows;
lightpoint.shade_self = Submodel.bShadeSelf;
if (m_walkowner != nullptr)
{
lightpoint.owner = m_walkowner;