Skip to content

Enhance MMPX, Fixed some defects in the original algorithm #1876

Open
crashGG wants to merge 1 commit intoazahar-emu:masterfrom
crashGG:mmpx-ex
Open

Enhance MMPX, Fixed some defects in the original algorithm #1876
crashGG wants to merge 1 commit intoazahar-emu:masterfrom
crashGG:mmpx-ex

Conversation

@crashGG
Copy link
Copy Markdown

@crashGG crashGG commented Mar 12, 2026


Ignore Until Your PR has been created!

Enhance MMPX, Fixed some defects in the original algorithm by morphological analysis

lots of changes:

Use approximate pixels to capture more details
Use mixed to generate intermediate color pixels to create more texture transition details
Improved shape judgment, basically eliminating the bubble defects of the original version.
Almost rewrote most of the code.
Expanded morphological functions allow for greater control over details. The refactoring of the core algorithm (almost) completely eliminates bubbles generated by 4-pixel intersections.

The implementation of multiple early exit mechanisms significantly reduces computational overhead.

Prior to this PR, the shader had undergone extensive testing on other platforms.

The libretro port of this shader is available at [https://github.com/libretro/slang-shaders/blob/master/edge-smoothing/scalenx/shaders/mmpx-ex.slang] welcome feedback from retro game enthusiasts.

The ppsspp port of this shader is available at https://github.com/hrydgard/ppsspp/blob/master/assets/shaders/tex_mmpx_adv.csh

AI Usage Declaration
All algorithms and logic in this commit were authored by me.

AI was used only for:
Translating comments to English.
Fixing code syntax issues.

@OpenSauce04
Copy link
Copy Markdown
Member

OpenSauce04 commented Mar 12, 2026

Huge thanks for looking at this one. This is something that had been bugging me for ages but I had never been able to look at it because my shader programming knowledge is lacking.

@OpenSauce04 OpenSauce04 added this to the 2126.0 milestone Mar 12, 2026
@github-actions github-actions Bot added the needs verification Needs to complete an anti-AI challenge. label Mar 12, 2026
@github-actions github-actions Bot closed this Mar 12, 2026
@github-actions
Copy link
Copy Markdown

Welcome to the Azahar Emulator repository! Due to the surge of AI bots we have decided to add an extra verification step to new contributors. Please follow the exact instructions in your own written Pull Request description to reopen it.

@OpenSauce04 OpenSauce04 removed the needs verification Needs to complete an anti-AI challenge. label Mar 12, 2026
@OpenSauce04
Copy link
Copy Markdown
Member

The amount of code changed in this PR is huge, did you write all of this?

@OpenSauce04 OpenSauce04 reopened this Mar 12, 2026
@OpenSauce04 OpenSauce04 added the enhancement New feature or request label Mar 12, 2026
@crashGG
Copy link
Copy Markdown
Author

crashGG commented Mar 12, 2026

Yes. It was initially submitted to ppsspp and Duckstation to fix some obvious bugs. You can see a very early version here
stenzek/duckstation#3443
hrydgard/ppsspp#20485

@crashGG
Copy link
Copy Markdown
Author

crashGG commented Mar 19, 2026

Update Log: Fixed a bug in the original algorithm where "single jagged edges" were rounded; optimized the logic for determining transparent pixels. Simplified two functions and reused some pre-stored variables to improve performance.

@crashGG crashGG force-pushed the mmpx-ex branch 2 times, most recently from 471ab2a to 90b629a Compare April 19, 2026 08:19
…ogical analysis

Enhance MMPX, Fixed some defects in the original algorithm by morphological analysis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants