Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

To those wondering about Alpha Transparency #60

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

Closed
LexiBigCheese opened this issue Jan 19, 2025 · 0 comments
Closed

To those wondering about Alpha Transparency #60

LexiBigCheese opened this issue Jan 19, 2025 · 0 comments

Comments

@LexiBigCheese
Copy link

LexiBigCheese commented Jan 19, 2025

While the Previous for the first Texenv is the pixel that is currently in the framebuffer,
You instead want to notice this:

citro3d_sys::C3D_AlphaBlend(
    ctru_sys::GPU_BLEND_ADD,
    ctru_sys::GPU_BLEND_ADD,
    ctru_sys::GPU_SRC_ALPHA,
    ctru_sys::GPU_ONE_MINUS_SRC_ALPHA,
    ctru_sys::GPU_SRC_ALPHA,
    ctru_sys::GPU_ONE_MINUS_SRC_ALPHA,
);

which is ran when citro3d is initialised.
src is the output of your Texenvs, dst is the pixel currently in the framebuffer
think of this as:

output.rgb = colorEq(src.rgb * srcClr,dst.rgb * dstClr);
output.a = alphaEq(src.a * srcAlpha,dst.a * dstAlpha);

this means if you're not seeing alpha blending, the issue is probably elsewhere. For example, a misconfigured attr::Info, or perhaps use of buffer::Info::add (on any buffer info) multiple times in the same frame (in which case, use immediate mode rendering, described in #57)
It could also be the result of not dirtying your Texenvs if they are changed more than once in a frame, see #56

@rust3ds rust3ds locked and limited conversation to collaborators Mar 20, 2025
@ian-h-chamberlain ian-h-chamberlain converted this issue into discussion #68 Mar 20, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant