Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

[Sub Editor] Lights Randomly Don't Cast Shadows*

Open VaelophisNyx opened this issue 2 years ago • 4 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?

To clarify the title, sometimes any light placed in a room, set to cast shadows, will simply refuse to cast shadows at all unless it has its range increased (or decreased) to another arbitrary number. This small room in the photo below requires a light set to range 1200, otherwise the light completely ignores the walls

Screenshot_2 Screenshot_3

Best I can tell this may be a small-room issue, but I have had this occur in a large room as well. I can't think of any particular direct causes however. Reproduction steps are the best I have to go on. Edit: It appears this does stem slightly from light positioning, moving the pictured light left 2 grid spaces fixes it. However, I do believe this behavior is a bug worth figuring out. Additionally reducing the range after moving it reintroduces the bug

Reproduction steps

  1. Build a submarine
  2. Place a light
  3. Set the light to Cast Shadows and On
  4. Move it into a room and test if the light behaves
  5. If it does not, adjust the range up or down until it suddenly behaves

Bug prevalence

Happens regularly

Single player or multiplayer?

Other

-

Sub Editor, possibly affects singleplayer/multiplayer. Untested.

Version

v1.0.21.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

VaelophisNyx avatar Jul 21 '23 23:07 VaelophisNyx

I was able to repro this although a little differently.

  1. place a light down, set it on and to cast shadows
  2. set the range to 0
  3. increase the range
  4. occasionally the shadows work, but most of the time not. Decreasing the range makes the shadows work again

giists avatar Aug 07 '23 13:08 giists

so a friend and I may have pinned down why? Seems to be related to having no hulls at all, then adding a light. Once a hull is added it still won't fix it, but if you save & reload the sub, it fixes it. Maybe it's got something to do with physics body generation? IDK how the light code works

VaelophisNyx avatar Aug 08 '23 01:08 VaelophisNyx

Additionally shifting the entire submarine in the editor can move around the problem locations, even to other lights

VaelophisNyx avatar Aug 08 '23 01:08 VaelophisNyx

Might've been addressed by the changes in https://github.com/FakeFishGames/Barotrauma-development/pull/5372 (PR in our private repo), which fixed Lamp Causes Light Leak Through Hatches After Open & Close and Opened hatches/doors do not cast shadow when closed. Moving to QA for a re-test

Regalis11 avatar Sep 24 '24 08:09 Regalis11

Tested, could no longer repro the issue with either of the described repro steps.

Regalis11 avatar Nov 15 '24 07:11 Regalis11