17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-30 05:00:29 +01:00

Keep the hotspotpower of light points apart from their colour

This commit is contained in:
2026-10-19 17:51:13 +02:00
parent 8c00b0bc3d
commit 0545f93f24
4 changed files with 31 additions and 21 deletions

View File

@@ -385,9 +385,7 @@ void opengl46_local_lights::add_light_point(TSubModel const &Submodel, glm::mat4
auto const diffuse{Submodel.DiffuseOverride.r < 0.f ? // -1 indicates no override
glm::vec3{Submodel.f4Diffuse} :
Submodel.DiffuseOverride};
// hotspotpower of the model; this renderer keeps it apart from the colour
auto const multiplier{Submodel.diffuseMultiplier > 0.f ? Submodel.diffuseMultiplier : 1.f};
auto const color{to_linear(diffuse) * (Brightness * multiplier * Submodel.fVisible * std::min(Submodel.f4Emision.a, 1.f))};
auto const color{to_linear(diffuse) * (Brightness * Submodel.fHotspotPower * Submodel.fVisible * std::min(Submodel.f4Emision.a, 1.f))};
if (max_component(color) <= LIGHT_THRESHOLD)
{
return;