Fix for shadow rendering and GS Alpha handling for dither effects.#86
Merged
Conversation
Add GS alpha-aware sprite rendering for effect paths such as finder dither. Mode 0x41 now uses a two-pass approximation of (Cd - Cs) * As + Cd instead of normal sprite blending, fixing the overly strong camera fuzz. Also supports additive/subtractive/destination boost modes and restores normal sprite state after special draws.
wagrenier
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dither / finder effects
MikuPan now handles several PS2 GS alpha blend modes explicitly for 2D sprite/effect rendering instead of routing everything through the normal alpha blend path.
This fixes the camera/finder dither effect, which was previously drawn as an overly strong noisy overlay. The finder dither uses GS alpha mode 0x41, equivalent to:
(Cd - Cs) * As + CdThe renderer now supports the relevant GS alpha paths, including normal alpha, additive, subtractive, destination boost, and the destination-minus-source mode used by the finder dither. A small helper shader is used for the destination-alpha contribution needed by the 0x41 approximation.
Shadows
This also fixes several shadow rendering issues: