Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix 3D shadowcasting. #30861

Closed

Conversation

kevingranade
Copy link
Member

@kevingranade kevingranade commented May 26, 2019

Summary

SUMMARY: Bugfixes "Correct behavior of 3D shadowcasting mode"

Purpose of change

3D shadowcasting has a number of rendering bugs remaining, fix them.
A non-exhaustive list:
As in #29175 shockers are sometimes able to see and target you through a floor. With some debugging I determined the cause to be 3D shadowcasting.
When standing cardinally adjacent to a single opaque tile (wall or adult tree, etc), in 2D shadowcasting the area behind the tree is obscured, but in 3D it is visible.
When standing adjacent to a wall corner, in 2D shadowcasting the first tile of the wall is visible and the rest is occluded, in 3D the entire wall and anything behind it is visible.
3D shadowcasting does not cast directly up or down, so there's a shadow directly above and below the player.

Describe the solution

This is going to be a progressive process since I don't know what the problem is.

  • Extend shadowcasting test to trigger 3D shadowcasting and test 3D scenarios.
  • Add tests that characterize the breakage.
  • Replace recursive shadowcasting with iterative shadowcasting as outlined in Further shadowcasting optimizations #23373. In addition to being more performant, this should be easier to analyze and test.
  • Fix the bugs.

@KorGgenT KorGgenT added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Z-levels Levels below and above ground. labels May 26, 2019
@ZhilkinSerg ZhilkinSerg self-assigned this May 26, 2019
@kevingranade kevingranade changed the title Fix 3D shadowcasting. [WIP] Fix 3D shadowcasting. May 26, 2019
@kevingranade kevingranade force-pushed the fix-3d-shadowcasting branch from 2d606ad to 1439a28 Compare May 26, 2019 18:15
@ZhilkinSerg ZhilkinSerg removed their assignment May 27, 2019
@kevingranade
Copy link
Member Author

You can see the 5 scenarios that are failing, if anyone has noticed any other artifacts caused by toggling 2d/3d vision mode (there are probably many), please let me know and I'll look into them.

After further testing, it looks like the failure mode that let shockers shoot through ceilings is unrelated, it has something to do with map shifting logic.

@kevingranade kevingranade force-pushed the fix-3d-shadowcasting branch from 1439a28 to b7983ed Compare June 2, 2019 17:42
@kevingranade kevingranade force-pushed the fix-3d-shadowcasting branch from b7983ed to f3ccc4d Compare June 6, 2019 08:16
@kevingranade kevingranade deleted the fix-3d-shadowcasting branch June 12, 2019 20:29
@kevingranade kevingranade restored the fix-3d-shadowcasting branch June 12, 2019 20:29
@ifreund ifreund mentioned this pull request Jun 30, 2019
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Z-levels Levels below and above ground.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants