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

tr2/overlay: support 3d pickup animations #1827

Merged
merged 3 commits into from
Nov 5, 2024
Merged

tr2/overlay: support 3d pickup animations #1827

merged 3 commits into from
Nov 5, 2024

Conversation

rr-
Copy link
Collaborator

@rr- rr- commented Nov 4, 2024

Checklist

  • I have read the coding conventions
  • I have added a changelog entry about what my pull request accomplishes, or it is an internal change

Description

Resolves #1633. The dragon statuettes are kept as sprites for now.

@rr- rr- added Feature New functionality TR2 labels Nov 4, 2024
@rr- rr- self-assigned this Nov 4, 2024
@rr- rr- requested review from a team as code owners November 4, 2024 21:21
@rr- rr- requested review from lahm86, walkawayy and aredfan and removed request for a team November 4, 2024 21:21
@rr-
Copy link
Collaborator Author

rr- commented Nov 4, 2024

I'm not clearing the Z-Buffer as currently there's no API for this. As a consequence, there may be some clipping issues with certain geometries / positions, but I haven't been able to stumble upon this.

Copy link

github-actions bot commented Nov 4, 2024

Copy link
Collaborator

@lahm86 lahm86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!
There is some clipping as you mention, such as the shotgun and the key cards in Offshore Rig.
The only major issue I've noticed is the prayer wheels (puzzle1) in Barkhang, they don't appear on screen at all. But looking into the data, it seems they have no animations/frames, so I suppose behaviour for that is pretty much undefined. I had no idea this was an issue in the game. We will be able to fix this with an injection eventually, but I wonder if there is a workaround for that pickup in the meantime?

@rr- rr- force-pushed the 3d-pickup-anims branch 2 times, most recently from 4e6b80d to f10873a Compare November 5, 2024 01:25
@rr-
Copy link
Collaborator Author

rr- commented Nov 5, 2024

@lahm86 Fixed by moving away from viewport manipulation, opting for a different rendering approach (basically, we're just moving the viewport center point now). Additionally, I've added z-buffer clearing. While the results are acceptable, there are some sizing issues left that we'll need to address with injections. For example, the prayer wheels remain too large, and the dragon seal seems disproportionately small, among others.

On a related note, the bounding box for the 3D model of the prayer wheel appears to be broken (X and Y planes are reported to be 0). Since the bounding boxes are essential for rendering of 3D items, I've implemented a manual calculation for it. The function perhaps isn't ideally placed, but it's there if we need it later. Plus, it can help us establish the expected bounding box values to be injected once we get there.

@walkawayy
Copy link
Collaborator

I just tried to test this on the latest push (f10873a) and my game crashes when the game tries to load any level. Savegame, new game, or console.

@rr- rr- force-pushed the 3d-pickup-anims branch from f10873a to 8ac31f8 Compare November 5, 2024 01:46
Copy link
Collaborator

@walkawayy walkawayy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I tried to test every key item in every level. I didn't see any issues.

@rr- rr- merged commit 6c36549 into develop Nov 5, 2024
7 checks passed
@rr- rr- deleted the 3d-pickup-anims branch November 5, 2024 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New functionality TR2
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add 3D PickUp animations
4 participants