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

Chunk - Add the SA2B+ Specific NAT Strip Flag #38

Open
shaddatic opened this issue Nov 5, 2024 · 0 comments
Open

Chunk - Add the SA2B+ Specific NAT Strip Flag #38

shaddatic opened this issue Nov 5, 2024 · 0 comments
Labels
feature-request New feature or request

Comments

@shaddatic
Copy link

SA2B added a new Chunk strip flag to disable alpha test in the material itself, rather than relying on a texture flag. There's no official name for it, since it's technically a user-flag in Ninja's eyes, but the name I've chosen is NAT/No Alpha Test; but I'm open to other ideas and want to hear other opinions on it.

It's only job is to disable Alpha Test/draw with full transparency, I have confirmed this. Here's the code snippet where it's used (modified to be more readable):

if ( (fst & NJD_FST_NAT)   || // IF NoAlphaTest flag on material
    bld_src == NJD_FBS_ONE || // OR src is ONE
    bld_dst == NJD_FBD_ONE || // OR dst is ONE
    TexHasNoAlphaTestFlag() ) // OR no alpha test tex flag
{
    SetTransparentDraw(); // No Alpha Test, full transparancy, no Z write
}
else
    SetAlphaTestDraw(); // Alpha Test and Z write

And here is the definition for it:

#define NJD_FST_NAT       (0x80<<8) // 0x8000

I originally wanted to remove it in Render Fix, but models genuinely use it so I will continue to support it. That, and it is actually quite useful to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants