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

Rework alpha function #383

Merged
merged 2 commits into from
Mar 12, 2024
Merged

Rework alpha function #383

merged 2 commits into from
Mar 12, 2024

Conversation

Dr-HyperCake
Copy link
Contributor

I have reworked the alpha function material value. Forge has handled it as two separate values, but in fact it's only one. I've updated the IO code accordingly, as well as the material editor and material XML.

  • Materials have a new value called AlphaFunc. The two previous values, AlphaTest and AlphaFunction, are still supported via properties, but should not be used.
  • All alpha functions should now render correctly, including Pokken.
  • Material editor:
    • Always show the alpha function dropdown. The alpha test checkbox has been removed.
    • Added the alpha function values used in Pokken.
  • Material XML:
    • Export the value alphaFunc, instead of AlphaFunc and AlphaTest.
    • Renamed RefAlpha and cullmode, to alphaRef and cullMode, respectively, for consistency with other value names.
    • Previous keys are still supported, for backwards compatibility with existing material XML files.

@ScanMountGoat
Copy link
Collaborator

Our material testing strategy back in the day was manual and error prone, so it makes sense that some of the values were wrong. The new values make sense, and I'm just going to assume these have already been verified with Renderdoc and Cemu. This will be good to merge once the minor code issues have been resolved.

@Dr-HyperCake
Copy link
Contributor Author

I've verified all of the Smash values in-game, which match up exactly with OpenGL. The Pokken ones haven't been extensively tested, but the "Greater" mode is correct and is found used in several files, and given that the order is almost certainly the same, it appears to be correct and also matches DirectX.

@ScanMountGoat
Copy link
Collaborator

That makes sense. Thank you for looking into this :)

@ScanMountGoat ScanMountGoat merged commit 51bea4a into jam1garner:master Mar 12, 2024
1 check passed
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