Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

Lamp Causes Light Leak Through Hatches After Open & Close

Open brand175 opened this issue 2 years ago • 2 comments

Disclaimers

  • [X] I have searched the issue tracker to check if the issue has already been reported.
  • [ ] My issue happened while using mods.

What happened?

The lamp, when you open and close a hatch with buttons, the light will keep shining through the hatch even when it's closed. Example: Room is somewhat lit, you open the hatch with buttons, now the room is brighter, close the hatch and the room stays lit

https://github.com/Regalis11/Barotrauma/assets/20964160/46a4eb3d-208b-42e7-8de8-c374e7ea4892

Reproduction steps

Shown in video

Screenshot 2023-05-27 122553

Bug prevalence

Happens every time I play

Version

v1.0.13.2

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

light issue.zip

brand175 avatar May 27 '23 19:05 brand175

Thank you for the report!

I gave this a test, and it seems to be caused by how the lighting system marks convex hulls (things that cast shadows) as "hidden" from the light's point of view if they're behind a wall or an obstacle. The issue here is the door goes behind the floor structure when it's closing, marking it as "hidden", and the light will ignore it from that point onwards. Need to think a bit about a way to address this (forcing the door to become "unhidden" for all lights whenever it opens/closes wouldn't be ideal, because it'd significantly increase the amount of light calculations and be bad for performance).

Regalis11 avatar May 29 '23 12:05 Regalis11

Fixed in https://github.com/FakeFishGames/Barotrauma-development/commit/ade16256ada67b560899b7f26a639b002a37a401

Regalis11 avatar May 31 '24 07:05 Regalis11

Closing as tested and merged for the next patch/unstable.

NilanthAnimosus avatar Aug 26 '24 10:08 NilanthAnimosus