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

[SM64/F3D] Use WriteDifferingAndRevert for bleed #461

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Lilaa3
Copy link
Collaborator

@Lilaa3 Lilaa3 commented Sep 15, 2024

Write all logic remains unaffected, obviously.

A new dict was added to map each mode cmd to its default.
For the actual bleed part, we fIrst need to add geo mode reverts of the last material to the geo mode of the current material, since the current material may not set them now. For othermodes we do something different, get all reverts and add any that doesn´t get set again by the current material ignoring bleeding.
For the geo mode revert, we keep track of one geo mode command for set and clear, updating it as we go. For othermodes we keep track of all of the command types and then revert them using the new dict.

Diff example: Lilaa3/HackerSM64@c9d217e

@Lilaa3 Lilaa3 marked this pull request as draft September 15, 2024 15:06
@Lilaa3
Copy link
Collaborator Author

Lilaa3 commented Sep 15, 2024

Noticed something othermode is doing sigh back to vs code I go

@Lilaa3 Lilaa3 marked this pull request as ready for review September 15, 2024 16:09
Write all logic remains unaffected, obviously.

A new dict was added to map each mode cmd to its default.
For the actual bleed part, we fIrst need to add geo mode reverts of the last material to the geo mode of the current material, since the current material may not set them now. For othermodes we do something different, get all reverts and add any that doesn´t get set again by the current material ignoring bleeding.
For the geo mode revert, we keep track of one geo mode command for set and clear, updating it as we go. For othermodes we keep track of all of the command types and then revert them using the new dict.
Copy link
Contributor

@Reonu Reonu left a comment

Choose a reason for hiding this comment

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

This fixed my issues with point lights, thank you

@Lilaa3
Copy link
Collaborator Author

Lilaa3 commented Sep 16, 2024

I feel like I could improve this further in terms of how resets are handled, will look into it later today, functionality shouldn't change tho unless I find a bug

@Lilaa3 Lilaa3 marked this pull request as draft September 17, 2024 16:09
We cannot just assume that othermodeh or othermodel are always setting the same bits, so instead we write the diff of the current cmd to the one already in the reset dict, this means that if a materials sets rendermode and another sets alpha compare (for example) it will still revert the rendermode because those bits will be carried over in the reset dict
@Lilaa3 Lilaa3 marked this pull request as ready for review September 18, 2024 11:06
Lilaa3 added a commit to Lilaa3/fast64 that referenced this pull request Oct 1, 2024
Fixes lag at start up from draw layers being set unnecessarily.
Some clean up that I already did in Fast-64#461
Fixes lag at start up from draw layers being set unnecessarily.
Some clean up that I already did in Fast-64#461
Lilaa3 added a commit that referenced this pull request Oct 14, 2024
* [Repo Settings] Only set if different

Fixes lag at start up from draw layers being set unnecessarily.
Some clean up that I already did in #461

* Request Changes

Co-Authored-By: Dragorn421 <[email protected]>

---------

Co-authored-by: Dragorn421 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants