Update : PSP

This commit is contained in:
Abdessamad DERRAZ
2021-04-20 12:59:47 +02:00
parent 835a359cea
commit 91c0d70c0c
114 changed files with 49906 additions and 2841 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -84,6 +84,15 @@ NPJH50579 = true
NPJH50558 = true
ULJS00456 = true
ULJS00454 = true
# Tales of Phantasia: Full Voice Edition
# Attempted workaround for stencil testing driver bug on Arm Exynos (similar to the previous Adreno bug).
# Seems that writing to depth disables a faulty optimization it's trying to do (as we saw in stencil draw).
ULJS00079 = true
ULJS19016 = true
UCAS40110 = true
NPJH50854 = true
# Heroes Phantasia Limited Edition Disc requires pixel depth rounding.
ULJS00455 = true
# Phantasy Star games flickering
@@ -112,6 +121,12 @@ NPJH90062 = true
# Phantasy Star Portable Infinity Demo
NPJH90157 = true # Infinity demo
# Nayuta no Kiseki might improve with pixel depth rounding. See issue #8744.
ULJM06113 = true
NPJH50625 = true
ULJM08069 = true
NPJH50625 = true
[DepthRangeHack]
# Phantasy Star Portable 2 and Infinity both use viewport depth outside [0, 1].
# This gets clamped in our current implementation, but attempts to fix it run into
@@ -140,13 +155,74 @@ ULJM91018 = true
NPJH90062 = true
# Phantasy Star Portable Infinity Demo
NPJH90157 = true # Infinity demo
[DisableRangeCulling]
# Phantasy Star games also have range culling issues.
# Phantasy Star Portable 2 and Infinity
ULJM05309 = true
ULUS10410 = true
ULES01218 = true
ULJM08023 = true
ULES01218 = true
# Phantasy Star Portable 1 Demo
NPUH90023 = true
# Phantasy Star Portable 2
ULES01439 = true
ULUS10529 = true
ULJM05493 = true
NPJH50043 = true
ULJM08030 = true
NPUH90023 = true
ULJM91014 = true
NPJH90002 = true
ULJM05732 = true
NPJH50332 = true
# Phantasy Star Portable 2 JP Demo
ULJM91018 = true
NPJH90062 = true
# Phantasy Star Portable Infinity Demo
NPJH90157 = true # Infinity demo
# Test Drive Unlimited
# just to disable range culling without adding another hack
# since it causes a lot of missing geometry when driving
ULET00386 = true
ULES00637 = true
ULKS46126 = true
ULUS10249 = true
# Metal Gear Solid : Peace Walker (see issue #12348)
ULUS10509 = true
ULES01372 = true
ULJM08038 = true
NPJH50045 = true
ULJM05630 = true
NPJH90082 = true
NPJH90063 = true
# Metal Gear Solid : Peace Walker Demo Ops (see issue #12348)
NPUH90066 = true
NPHH00145 = true
NPEH90023 = true
# Metal Gear Solid: Portable Ops (see issue #12348)
ULES00645 = true
ULJM05193 = true
ULJM05227 = true
ULUS10202 = true
ULES01003 = true
ULJM05261 = true
ULUS10290 = true
ULED90040 = true
ULJM05284 = true
ULES00645 = true
# Splinter Cell Essentials (#13035)
ULES00281 = true
ULUS10070 = true
# Asphalt 2 (#14299)
ULES00719 = true
# No US release, it seems
[ClearToRAM]
# SOCOM Navy Seals games require this. See issue #8973.
# Navy Seals : Tactical Strike
@@ -351,6 +427,8 @@ ULES01372 = true
ULJM08038 = true
NPJH50045 = true
ULJM05630 = true
NPJH90082 = true
NPJH90063 = true
# Star Ocean : Second Evolution
ULUS10375 = true
ULES01187 = true
@@ -363,17 +441,71 @@ ULES00740 = true
# Chili Con Carnage
ULUS10216 = true
ULES00629 = true
# Digimon Adventure
NPJH50686 = true
ULJS00541 = true
ULAS42340 = true
# Danganronpa
ULJS00337 = true
ULJS19060 = true
NPJH50372 = true
NPJH50515 = true
# Danganronpa Demo
NPJH90164 = true
# Super Danganronpa 2
ULJS00521 = true
ULJS00522 = true
NPJH50631 = true
# The Simpsons Game
ULUS10295 = true
ULES00975 = true
ULES00979 = true
ULES00978 = true
ULES00977 = true
ULES00976 = true
# Jeanne d'Arc
UCUS98700 = true
UCJS10048 = true
# Jeanne d'Arc Senkou Taikenban (Demo)
UCJX90019 = true
# Dante's Inferno
ULUS10469 = true
ULES01384 = true
ULJM05621 = true
NPJH50220 = true
ULJM05799 = true
ULKS46248 = true
# Test Drive Unlimited
ULUS10249 = true
ULES00637 = true
ULKS46126 = true
# Silent Hill: Shattered Memories
ULUS10450 = true
ULES01352 = true
ULJM05564 = true
NPJH50148 = true
ULAS42189 = true
# Silent Hill: Origins
ULUS10285 = true
ULES00869 = true
ULJM05281 = true
NPJH50051 = true
# Manhunt 2
ULUS10280 = true
ULES00756 = true
# LEGO Star Wars II: The Original Trilogy
ULUS10155 = true
ULES00479 = true
# LEGO Indiana Jones: The Original Adventures
ULUS10365 = true
ULES01086 = true
# LEGO Batman: The Videogame
ULUS10380 = true
ULES01151 = true
# TODO: There are many more.
[RequireBlockTransfer]
# Warn the user that the game will have issue graphic, if simulate block transfer is not enabled.
# Ys Seven need it to fix minimap. See issues #2928
ULUS10551 = true
ULJM05475 = true
NPEH00065 = true
NPJH50350 = true
ULJM08041 = true
NPEH00065 = true
# The Legend of Heroes: Trails in the Sky need it to fix graphical glitch in menu screen. See issues #8053
ULUS10540 = true
ULUS10578 = true
@@ -387,17 +519,13 @@ NPUH10197 = true
ULJS00394 = true
ULJS19068 = true
NPJH50518 = true
# TODO: Will add some games in the future
NPJH50686 = true # Digimon Adventures (JP, and English patches...)
ULJS00078 = true # MotoGP
ULUS10153 = true # MotoGP
UCES00373 = true # MotoGP
ULUS10551 = true # Ys Seven
ULJM05475 = true # Ys Seven JP
ULUS10549 = true # Ys Seven
NPEH00065 = true # Ys Seven
NPJH50350 = true # Ys Seven
ULJM08041 = true # Ys Seven
# Gradius Collection (see #13887)
ULUS10103 = true
ULES00381 = true
ULJM05091 = true
# GachiTora! Abarenbou Kyoushi in High School need it to render shadows properly (see #14136)
ULJS00355 = true
NPJH50409 = true
[DisableAccurateDepth]
# Midnight Club: LA Remix
@@ -451,8 +579,13 @@ NPJG90095 = true
NPEG90035 = true
NPUG70125 = true
# Tekken 6
ULES01376 = true
ULUS10466 = true
ULES01376 = true
ULJS00224 = true
NPUH10047 = true
ULAS42214 = true
ULJS19054 = true
NPJH50184 = true
[MGS2AcidHack]
ULUS10006 = true # Metal Gear Acid
@@ -475,16 +608,78 @@ ULES00940 = true # SR2
ULET00958 = true
[BlockTransferAllowCreateFB]
NPJH50686 = true # Digimon Adventures (JP, and English patches...)
ULJS00078 = true # MotoGP
ULUS10153 = true # MotoGP
UCES00373 = true # MotoGP
ULUS10551 = true # Ys Seven
ULJM05475 = true # Ys Seven JP
ULUS10549 = true # Ys Seven
NPEH00065 = true # Ys Seven
NPJH50350 = true # Ys Seven
ULJM08041 = true # Ys Seven
# Digimon Adventure (JP and English patches)
NPJH50686 = true
ULJS00541 = true
ULAS42340 = true
# MotoGP
ULUS10153 = true
UCES00373 = true
ULJS00078 = true
UCAS40104 = true
# Ys Seven
ULUS10551 = true
ULJM05475 = true
ULJM05475 = true
NPEH00065 = true
NPJH50350 = true
# Burnout Legends
ULES00125 = true
ULUS10025 = true
ULJM05228 = true
NPJH50305 = true
ULJM05049 = true
ULKS46027 = true
ULAS42019 = true
# Burnout Dominator
ULUS10236 = true
ULES00750 = true
ULJM05242 = true
ULJM05371 = true
NPJH50304 = true
ULES00703 = true
# Test Drive Unlimited
ULET00386 = true
ULUS10249 = true
ULES00637 = true
ULKS46126 = true
# Naruto Shippuden: Ultimate Ninja Impact
ULUS10582 = true
ULES01537 = true
ULJS00390 = true
ULAS42297 = true
ULJS19071 = true
NPJH50435 = true
NPJH50435 = true
# Gradius Collection
ULUS10103 = true
ULES00381 = true
ULJM05091 = true
ULJM05222 = true
ULAS42040 = true
ULKS46064 = true
[IntraVRAMBlockTransferAllowCreateFB]
# Final Fantasy - Type 0
ULJM05900 = true
ULJM05901 = true
NPJH50443 = true
NPJH50444 = true
ULJM06217 = true
ULJM06218 = true
UCAS40346 = true
UCAS40347 = true
# Boku no Natsuyasumi: Mushi Mushi Hakase to Teppen-yama no Himitsu!!
UCJS10038 = true
UCJS18013 = true
# Note! This whole flag is disabled temporarily by appending "Disabled" to its name). See 7914
[YugiohSaveFixDisabled]
@@ -605,8 +800,13 @@ ULES01287 = true
ULUS10433 = true
# Tekken 6
ULES01376 = true
ULUS10466 = true
ULES01376 = true
ULJS00224 = true
NPUH10047 = true
ULAS42214 = true
ULJS19054 = true
NPJH50184 = true
# Hot Wheels - Ultimate Racing (issue #12604, this is a workaround)
ULUS10239 = true
@@ -625,7 +825,6 @@ ULUS10287 = true # Super Collapse 3
ULES01027 = true # Super Collapse 3
ULUS10203 = true # Platypus
ULES01029 = true # Platypus
ULUS10201 = true # Luxor: The Wrath of Set
ULUS10227 = true # 7 Wonders of the Ancient World
ULES01037 = true # 7 Wonders of the Ancient World
@@ -633,6 +832,21 @@ ULES01037 = true # 7 Wonders of the Ancient World
ULES00364 = true
ULUS10132 = true
# Homebrew Kurok (we don't normally add homebrew here but it has a distinctive GameID)
KURO00767 = true
# Scooby-Doo! Who's Watching Who?
ULUS10168 = true
ULES00571 = true
# Tron Evolution
ULUS10548 = true
ULES01494 = true
ULES01495 = true
# Atari Classics Evolved
ULUS10325 = true
[JitInvalidationHack]
# This is an absolutely awful hack that somehow prevents issues when clearing the JIT,
# if the game has copied code with EmuHack opcodes or something. Hopefully will be able
@@ -698,3 +912,118 @@ ULJM05005 = true
ULES00016 = true
ULUS10005 = true
ULJM05005 = true
[ReportSmallMemStick]
# Harry Potter and the Goblet of Fire - issue #13266
ULUS10032 = true
ULES00210 = true
# Street Fighter Alpha 3 MAX - issue #10462
ULJM05082 = true
ULUS10062 = true
ULES00235 = true
ULJM05225 = true
CPCS01043 = true
ULUS10062 = true
# LEGO Star Wars II: The Original Trilogy
ULES00479 = true
ULUS10155 = true
# Tony Hawk's Underground 2 Remix
ULES00033 = true
ULUS10014 = true
# Virtua Tennis: World Tour
ULES00126 = true
ULJM05079 = true
ULKS46023 = true
ULUS10037 = true
[MemstickFixedFree]
ULJM05571 = true
ULES01367 = true
NPEH00029 = true
ULUS10455 = true
[DateLimited]
# Car Jack Streets - issue #12698
NPUZ00043 = true
NPEZ00198 = true
# This setting will go away in the near future, hopefully we can enable it
# for all or most games.
[ReinterpretFramebuffers]
# Outrun 2006: Coast to Coast - issue #11358 (car reflections)
ULES00262 = true
ULUS10064 = true
ULKS46087 = true
# Colin McRae's DiRT 2 - issue #13012 (car lighting)
ULUS10471 = true
ULJM05533 = true
NPJH50006 = true
ULES01301 = true
# Ultimate Ghosts & Goblins
ULJM05147 = true
ULUS10105 = true
ULES00419 = true
NPJH50235 = true
ULAS42073 = true
# Goku Makai-Mura Kai (variant of Ultimate Ghosts & Goblins)
ULJM05265 = true
ULJM05366 = true
# Kingdom Hearts (see #11223)
ULUS10505 = true
ULES01441 = true
ULJM05600 = true
ULJM05775 = true
[ShaderColorBitmask]
# Outrun 2006: Coast to Coast - issue #11358
ULES00262 = true
ULUS10064 = true
ULKS46087 = true
# Colin McRae's DiRT 2 - issue #13012 (car lighting)
ULUS10471 = true
ULJM05533 = true
NPJH50006 = true
ULES01301 = true
[DoublePrecisionSinCos]
# Hitman Reborn Battle Arena 2 (#12900)
ULJS00218 = true
# Hitman Reborn Battle Arena
ULJS00157 = true
[DisableFirstFrameReadback]
# Wipeout Pure: Temporary workaround for lens flare flicker. See #13344
UCUS98612 = true
UCJS10007 = true
UCES00001 = true
UCKS45008 = true
NPJG00059 = true
[MpegAvcWarmUp]
# God Eater issue #13527 ,It is custom mpeg library that required sceMpegGetAvcAu return ERROR_MPEG_NO_DATA but break FIFA 14 issue #14086
# God Eater 1
ULJS00237 = true
ULKS46238 = true
# God Eater 2
ULJS00597 = true
NPJH50832 = true
ULJS19093 = true
NPJH50832 = true
# God Eater Burst
ULJS00351 = true
NPJH50352 = true
ULJS00350 = true
ULKS46263 = true
ULUS10563 = true
ULES01519 = true
ULJS19056 = true
NPJH50352 = true
ULUS10563FV = true
ULJS19081 = true
NPJH50352 = true

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -195,3 +195,6 @@ bd1200000000000015d0000000000000,Tomee SNES USB Controller,x:b3,a:b2,b:b1,y:b0,b
030000000d0f0000ee00000011010000,HORI CO.,LTD. HORIPAD mini4,platform:Linux,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
030000000d0f0000c100000011010000,HORI CO.,LTD. HORIPAD S,platform:Linux,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
03000000ad1b000003f5000033050000,Hori Fighting Stick VX,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b8,guide:b10,start:b9,leftshoulder:b4,rightshoulder:b5,-leftx:h0.8,+leftx:h0.2,-lefty:h0.1,+lefty:h0.4,lefttrigger:b6,righttrigger:b7,
03000000c82d00000260000011010000,8Bitdo SF30 Pro 8BitDo SN30 Pro+,platform:Linux,a:b1,b:b0,x:b4,y:b3,back:b10,guide:b2,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,
060000007e0500000820000000000000,Nintendo Switch Combined Joy-Cons,platform:Linux,a:b0,b:b1,x:b3,y:b2,back:b9,guide:b11,start:b10,leftstick:b12,rightstick:b13,leftshoulder:b5,rightshoulder:b6,dpup:b14,dpdown:b15,dpleft:b16,dpright:b17,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b7,righttrigger:b8,
05000000491900000204000000000000,PG-9118,platform:Linux,x:b76,a:b73,b:b74,y:b77,back:b83,start:b84,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b79,lefttrigger:b81,rightshoulder:b80,righttrigger:b82,leftstick:b86,rightstick:b87,leftx:a0,lefty:a1,rightx:a2,righty:a3,

View File

@@ -0,0 +1,28 @@
# lang
PPSSPP language ini repository
# Thanks for your interest in translating PPSSPP!
* Simply copy *en_US.ini* file to a new ini file with your language code, or use it to update an existing file with that name.
* To see a list of codes, view [this](http://stackoverflow.com/questions/3191664/list-of-all-locales-and-their-short-codes) page.
# Please note, while translating:
* Ampersands `&` on the *RIGHT* side of an equals sign denote an underlined keyboard hotkey.
* The hotkeys are only supported currently in the *DesktopUI* section, however.
* Example: `&File`. This will make it so when you press ALT + F on Windows, it'll open the File menu.
# Tools
* To remove a translation, use the following (where KeyWord is the key):
find . -type f -print0 | xargs -0 sed -i /^KeyWord/d
* To change a translation key, use something like this:
find . -type f -print0 | xargs -0 sed -i /^Key/NewKey
* Before you commit, use git diff to check that you don't delete too much
or some unrelated key with the same prefix.
### Happy translating!

1080
system/PPSSPP/lang/ar_AE.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/az_AZ.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/bg_BG.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/ca_ES.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/cz_CZ.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/da_DK.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/de_DE.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/dr_ID.ini Normal file

File diff suppressed because it is too large Load Diff

1097
system/PPSSPP/lang/en_US.ini Normal file

File diff suppressed because it is too large Load Diff

1066
system/PPSSPP/lang/es_ES.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/es_LA.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/fa_IR.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/fi_FI.ini Normal file

File diff suppressed because it is too large Load Diff

1063
system/PPSSPP/lang/fr_FR.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/gl_ES.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/gr_EL.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/he_IL.ini Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/hr_HR.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/hu_HU.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/id_ID.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/it_IT.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/ja_JP.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/jv_ID.ini Normal file

File diff suppressed because it is too large Load Diff

1074
system/PPSSPP/lang/ko_KR.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/lo_LA.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/lt-LT.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/ms_MY.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/nl_NL.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/no_NO.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/pl_PL.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/pt_BR.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/pt_PT.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/ro_RO.ini Normal file

File diff suppressed because it is too large Load Diff

1073
system/PPSSPP/lang/ru_RU.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/sv_SE.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/tg_PH.ini Normal file

File diff suppressed because it is too large Load Diff

1073
system/PPSSPP/lang/th_TH.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/tr_TR.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/uk_UA.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/vi_VN.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/zh_CN.ini Normal file

File diff suppressed because it is too large Load Diff

1072
system/PPSSPP/lang/zh_TW.ini Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

BIN
system/PPSSPP/sfx_back.wav Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,3 +1,8 @@
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
attribute vec4 a_position;
attribute vec2 a_texcoord0;
uniform vec2 u_texelDelta;

View File

@@ -18,6 +18,12 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
attribute vec4 a_position;
attribute vec2 a_texcoord0;
varying vec2 v_texcoord0;

View File

@@ -1,6 +1,11 @@
// by guest(r) - guest.r@gmail.com
// license: GNU-GPL
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
attribute vec4 a_position;
attribute vec2 a_texcoord0;
uniform vec2 u_texelDelta;

View File

@@ -10,8 +10,7 @@ precision mediump int;
uniform sampler2D sampler0;
varying vec2 v_texcoord0;
float amount = 0.60; // suitable range = 0.00 - 1.00
float power = 0.5; // suitable range = 0.0 - 1.0
uniform vec4 u_setting;
void main()
{
@@ -21,9 +20,9 @@ void main()
for(int i= -3 ;i < 3; i++)
{
sum += texture2D(sampler0, v_texcoord0 + vec2(-1, i)*0.004) * amount;
sum += texture2D(sampler0, v_texcoord0 + vec2(0, i)*0.004) * amount;
sum += texture2D(sampler0, v_texcoord0 + vec2(1, i)*0.004) * amount;
sum += texture2D(sampler0, v_texcoord0 + vec2(-1, i)*0.004) * u_setting.x;
sum += texture2D(sampler0, v_texcoord0 + vec2(0, i)*0.004) * u_setting.x;
sum += texture2D(sampler0, v_texcoord0 + vec2(1, i)*0.004) * u_setting.x;
}
if (color.r < 0.3 && color.g < 0.3 && color.b < 0.3)
@@ -42,7 +41,7 @@ void main()
}
}
bloom = mix(color, bloom, power);
bloom = mix(color, bloom, u_setting.y);
gl_FragColor.rgb = bloom;
gl_FragColor.a = 1.0;
}

View File

@@ -10,7 +10,7 @@ precision mediump float;
precision mediump int;
#endif
const float bb = 0.5; // effects black border sensitivity; from 0.0 to 1.0
uniform vec4 u_setting;
uniform sampler2D sampler0;
@@ -39,7 +39,7 @@ void main()
float d2=dot(abs(c20-c02),dt);
float hl=dot(abs(c01-c21),dt);
float vl=dot(abs(c10-c12),dt);
float d = bb*(d1+d2+hl+vl)/(dot(c11,dt)+0.15);
float d = u_setting.x*(d1+d2+hl+vl)/(dot(c11,dt)+0.15);
float lc = 4.0*length(c11);
float f = fract(lc); f*=f;

View File

@@ -1,3 +1,8 @@
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
attribute vec4 a_position;
attribute vec2 a_texcoord0;
uniform vec2 u_texelDelta;

View File

@@ -0,0 +1,20 @@
// Color correction
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
uniform sampler2D sampler0;
varying vec2 v_texcoord0;
uniform vec4 u_setting;
void main()
{
vec3 rgb = texture2D( sampler0, v_texcoord0 ).xyz;
rgb = vec3(mix(vec3(dot(rgb, vec3(0.299, 0.587, 0.114))), rgb, u_setting.y));
rgb = (rgb-0.5)*u_setting.z+0.5+u_setting.x-1.0;
gl_FragColor.rgb = pow(rgb, vec3(1.0/u_setting.w));
gl_FragColor.a = 1.0;
}

View File

@@ -17,7 +17,7 @@ Vertex=natural.vsh
[NaturalA]
Name=Natural Colors (No Blur)
Fragment=naturalA.fsh
Vertex=natural.vsh
Vertex=naturalA.vsh
[Vignette]
Name=Vignette
Author=Henrik
@@ -32,10 +32,23 @@ Vertex=fxaa.vsh
Name=Bloom
Fragment=bloom.fsh
Vertex=fxaa.vsh
SettingName1=Amount
SettingDefaultValue1=0.6
SettingMaxValue1=1.0
SettingMinValue1=0.0
SettingName2=Power
SettingDefaultValue2=0.5
SettingMaxValue2=1.0
SettingMinValue2=0.0
[Sharpen]
Name=Sharpen
Fragment=sharpen.fsh
Vertex=fxaa.vsh
SettingName1=Amount
SettingDefaultValue1=1.5
SettingMaxValue1=3.0
SettingMinValue1=1.0
SettingStep1=0.1
[InverseColors]
Name=Inverse Colors
Author=Henrik
@@ -46,10 +59,24 @@ Name=Scanlines (CRT)
Fragment=scanlines.fsh
Vertex=fxaa.vsh
OutputResolution=True
SettingName1=Amount
SettingDefaultValue1=1.0
SettingMaxValue1=1.0
SettingMinValue1=0.0
SettingStep1=0.1
SettingName2=Intensity
SettingDefaultValue2=0.5
SettingMaxValue2=1.0
SettingMinValue2=0.0
SettingStep2=0.05
[Cartoon]
Name=Cartoon
Fragment=cartoon.fsh
Vertex=cartoon.vsh
SettingName1=Black border
SettingDefaultValue1=0.5
SettingMaxValue1=1.0
SettingMinValue1=0.0
[4xHqGLSL]
Name=4xHqGLSL Upscaler
Fragment=4xhqglsl.fsh
@@ -93,3 +120,43 @@ Fragment=GaussianDownscale.fsh
Vertex=fxaa.vsh
OutputResolution=True
SSAA=2
[ColorCorrection]
Name=Color correction
Fragment=colorcorrection.fsh
Vertex=fxaa.vsh
SettingName1=Brightness
SettingDefaultValue1=1.0
SettingMaxValue1=2.0
SettingMinValue1=0.1
SettingStep1=0.05
SettingName2=Saturation
SettingDefaultValue2=1.0
SettingMaxValue2=2.0
SettingMinValue2=0.0
SettingStep2=0.1
SettingName3=Contrast
SettingDefaultValue3=1.0
SettingMaxValue3=3.0
SettingMinValue3=0.1
SettingStep3=0.1
SettingName4=Gamma
SettingDefaultValue4=1.0
SettingMaxValue4=2.0
SettingMinValue4=0.1
SettingStep4=0.05
[PSPColor]
Name=PSP Color
Author=hunterk, Pokefan531 (ported by jdgleaver)
Fragment=psp_color.fsh
Vertex=fxaa.vsh
[Tex4xBRZ]
Type=Texture
Name=4xBRZ
Author=Hyllian
Compute=tex_4xbrz.csh
[TexMMPX]
Type=Texture
Name=MMPX
Author=Morgan McGuire and Mara Gagiu
Compute=tex_mmpx.csh
MaxScale=2

View File

@@ -1,3 +1,8 @@
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
attribute vec4 a_position;
attribute vec2 a_texcoord0;
varying vec2 v_texcoord0;

View File

@@ -1,3 +1,8 @@
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
uniform vec2 u_texelDelta;
attribute vec4 a_position;

View File

@@ -1,6 +1,6 @@
// Natural Vision Shader with removed blur.
// Natural Vision Shader, modified to use in PPSSPP.
// by ShadX (Modded by SimoneT and Leopard20)
// by ShadX (Modded by SimoneT)
// http://forums.ngemu.com/showthread.php?t=76098
#ifdef GL_ES
@@ -9,10 +9,7 @@ precision mediump int;
#endif
uniform sampler2D sampler0;
varying vec4 v_texcoord0;
varying vec4 v_texcoord1;
varying vec4 v_texcoord2;
varying vec4 v_texcoord3;
varying vec2 v_texcoord0;
const mat3 RGBtoYIQ = mat3(0.299, 0.596, 0.212,
0.587,-0.275,-0.523,
@@ -28,7 +25,7 @@ void main()
{
vec3 c0,c1;
c0 = texture2D(sampler0,v_texcoord0.xy).xyz;
c0 = texture2D(sampler0,v_texcoord0).xyz;
c1=RGBtoYIQ*c0;

View File

@@ -0,0 +1,15 @@
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
attribute vec4 a_position;
attribute vec2 a_texcoord0;
varying vec2 v_texcoord0;
void main()
{
gl_Position=a_position;
v_texcoord0=a_texcoord0;
}

View File

@@ -0,0 +1,58 @@
/*
psp_color vertex shader
Original code written by hunterk, modified by Pokefan531 and
released into the public domain
'Ported' (i.e. copy/paste) to PPSSPP format by jdgleaver
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
Notes: This shader replicates the LCD dynamics of the PSP 1000 and PSP 2000
*/
//================
#ifdef GL_ES
precision mediump float;
precision mediump int;
// For android, use this instead...
//precision highp float;
//precision highp int;
//
#endif
//================
#define target_gamma 2.21
#define display_gamma 2.2
#define r 0.98
#define g 0.795
#define b 0.98
#define rg 0.04
#define rb 0.01
#define gr 0.20
#define gb 0.01
#define br -0.18
#define bg 0.165
//================
uniform sampler2D sampler0;
varying vec2 v_texcoord0;
//================
void main()
{
// Apply colour correction
vec3 screen = pow(texture2D(sampler0, v_texcoord0.xy).rgb, vec3(target_gamma));
// screen = clamp(screen, 0.0, 1.0);
screen = pow(
mat3(r, rg, rb,
gr, g, gb,
br, bg, b) * screen,
vec3(1.0 / display_gamma)
);
gl_FragColor = vec4(screen, 1.0);
}

View File

@@ -8,13 +8,12 @@ precision mediump int;
uniform sampler2D sampler0;
varying vec2 v_texcoord0;
float amount = 1.0; // suitable range = 0.0 - 1.0
float intensity = 0.5; // suitable range = 0.0 - 1.0
uniform vec4 u_setting;
void main()
{
float pos0 = ((v_texcoord0.y + 1.0) * 170.0*amount);
float pos1 = cos((fract( pos0 ) - 0.5)*3.1415926*intensity)*1.5;
float pos0 = ((v_texcoord0.y + 1.0) * 170.0*u_setting.x);
float pos1 = cos((fract( pos0 ) - 0.5)*3.1415926*u_setting.y)*1.5;
vec4 rgb = texture2D( sampler0, v_texcoord0 );
// slight contrast curve

View File

@@ -8,12 +8,12 @@ precision mediump int;
uniform sampler2D sampler0;
varying vec2 v_texcoord0;
float amount = 1.5;
uniform vec4 u_setting;
void main()
{
vec3 color = texture2D(sampler0, v_texcoord0.xy).xyz;
color -= texture2D(sampler0, v_texcoord0.xy+0.0001).xyz*7.0*amount;
color += texture2D(sampler0, v_texcoord0.xy-0.0001).xyz*7.0*amount;
color -= texture2D(sampler0, v_texcoord0.xy+0.0001).xyz*7.0*u_setting.x;
color += texture2D(sampler0, v_texcoord0.xy-0.0001).xyz*7.0*u_setting.x;
gl_FragColor.rgb = color;
}

View File

@@ -0,0 +1,279 @@
// 4xBRZ shader - Copyright (C) 2014-2016 DeSmuME team (GPL2+)
// Hyllian's xBR-vertex code and texel mapping
// Copyright (C) 2011/2016 Hyllian - sergiogdb@gmail.com
#define BLEND_ALPHA 1
#define BLEND_NONE 0
#define BLEND_NORMAL 1
#define BLEND_DOMINANT 2
#define LUMINANCE_WEIGHT 1.0
#define EQUAL_COLOR_TOLERANCE 30.0/255.0
#define STEEP_DIRECTION_THRESHOLD 2.2
#define DOMINANT_DIRECTION_THRESHOLD 3.6
float reduce(vec4 color) {
return dot(color.rgb, vec3(65536.0, 256.0, 1.0));
}
float DistYCbCr(vec4 pixA, vec4 pixB) {
// https://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.2020_conversion
const vec3 K = vec3(0.2627, 0.6780, 0.0593);
const mat3 MATRIX = mat3(K,
-.5 * K.r / (1.0 - K.b), -.5 * K.g / (1.0 - K.b), .5,
.5, -.5 * K.g / (1.0 - K.r), -.5 * K.b / (1.0 - K.r));
vec4 diff = pixA - pixB;
vec3 YCbCr = diff.rgb * MATRIX;
YCbCr.x *= LUMINANCE_WEIGHT;
float d = length(YCbCr);
return sqrt(pixA.a * pixB.a * d * d + diff.a * diff.a);
}
bool IsPixEqual(const vec4 pixA, const vec4 pixB) {
return (DistYCbCr(pixA, pixB) < EQUAL_COLOR_TOLERANCE);
}
bool IsBlendingNeeded(const ivec4 blend) {
ivec4 diff = blend - ivec4(BLEND_NONE);
return diff.x != 0 || diff.y != 0 || diff.z != 0 || diff.w != 0;
}
vec4 applyScalingf(uvec2 origxy, uvec2 xy) {
float dx = 1.0 / params.width;
float dy = 1.0 / params.height;
// A1 B1 C1
// A0 A B C C4
// D0 D E F F4
// G0 G H I I4
// G5 H5 I5
uvec4 t1 = uvec4(origxy.x - 1, origxy.x, origxy.x + 1, origxy.y - 2); // A1 B1 C1
uvec4 t2 = uvec4(origxy.x - 1, origxy.x, origxy.x + 1, origxy.y - 1); // A B C
uvec4 t3 = uvec4(origxy.x - 1, origxy.x, origxy.x + 1, origxy.y + 0); // D E F
uvec4 t4 = uvec4(origxy.x - 1, origxy.x, origxy.x + 1, origxy.y + 1); // G H I
uvec4 t5 = uvec4(origxy.x - 1, origxy.x, origxy.x + 1, origxy.y + 2); // G5 H5 I5
uvec4 t6 = uvec4(origxy.x - 2, origxy.y - 1, origxy.y, origxy.y + 1); // A0 D0 G0
uvec4 t7 = uvec4(origxy.x + 2, origxy.y - 1, origxy.y, origxy.y + 1); // C4 F4 I4
vec2 f = fract(vec2(float(xy.x) / float(params.scale), float(xy.y) / float(params.scale)));
//---------------------------------------
// Input Pixel Mapping: |21|22|23|
// 19|06|07|08|09
// 18|05|00|01|10
// 17|04|03|02|11
// |15|14|13|
vec4 src[25];
src[21] = readColorf(t1.xw);
src[22] = readColorf(t1.yw);
src[23] = readColorf(t1.zw);
src[ 6] = readColorf(t2.xw);
src[ 7] = readColorf(t2.yw);
src[ 8] = readColorf(t2.zw);
src[ 5] = readColorf(t3.xw);
src[ 0] = readColorf(t3.yw);
src[ 1] = readColorf(t3.zw);
src[ 4] = readColorf(t4.xw);
src[ 3] = readColorf(t4.yw);
src[ 2] = readColorf(t4.zw);
src[15] = readColorf(t5.xw);
src[14] = readColorf(t5.yw);
src[13] = readColorf(t5.zw);
src[19] = readColorf(t6.xy);
src[18] = readColorf(t6.xz);
src[17] = readColorf(t6.xw);
src[ 9] = readColorf(t7.xy);
src[10] = readColorf(t7.xz);
src[11] = readColorf(t7.xw);
float v[9];
v[0] = reduce(src[0]);
v[1] = reduce(src[1]);
v[2] = reduce(src[2]);
v[3] = reduce(src[3]);
v[4] = reduce(src[4]);
v[5] = reduce(src[5]);
v[6] = reduce(src[6]);
v[7] = reduce(src[7]);
v[8] = reduce(src[8]);
ivec4 blendResult = ivec4(BLEND_NONE);
// Preprocess corners
// Pixel Tap Mapping: --|--|--|--|--
// --|--|07|08|--
// --|05|00|01|10
// --|04|03|02|11
// --|--|14|13|--
// Corner (1, 1)
if ( ((v[0] == v[1] && v[3] == v[2]) || (v[0] == v[3] && v[1] == v[2])) == false) {
float dist_03_01 = DistYCbCr(src[ 4], src[ 0]) + DistYCbCr(src[ 0], src[ 8]) + DistYCbCr(src[14], src[ 2]) + DistYCbCr(src[ 2], src[10]) + (4.0 * DistYCbCr(src[ 3], src[ 1]));
float dist_00_02 = DistYCbCr(src[ 5], src[ 3]) + DistYCbCr(src[ 3], src[13]) + DistYCbCr(src[ 7], src[ 1]) + DistYCbCr(src[ 1], src[11]) + (4.0 * DistYCbCr(src[ 0], src[ 2]));
bool dominantGradient = (DOMINANT_DIRECTION_THRESHOLD * dist_03_01) < dist_00_02;
blendResult[2] = ((dist_03_01 < dist_00_02) && (v[0] != v[1]) && (v[0] != v[3])) ? ((dominantGradient) ? BLEND_DOMINANT : BLEND_NORMAL) : BLEND_NONE;
}
// Pixel Tap Mapping: --|--|--|--|--
// --|06|07|--|--
// 18|05|00|01|--
// 17|04|03|02|--
// --|15|14|--|--
// Corner (0, 1)
if ( ((v[5] == v[0] && v[4] == v[3]) || (v[5] == v[4] && v[0] == v[3])) == false) {
float dist_04_00 = DistYCbCr(src[17], src[ 5]) + DistYCbCr(src[ 5], src[ 7]) + DistYCbCr(src[15], src[ 3]) + DistYCbCr(src[ 3], src[ 1]) + (4.0 * DistYCbCr(src[ 4], src[ 0]));
float dist_05_03 = DistYCbCr(src[18], src[ 4]) + DistYCbCr(src[ 4], src[14]) + DistYCbCr(src[ 6], src[ 0]) + DistYCbCr(src[ 0], src[ 2]) + (4.0 * DistYCbCr(src[ 5], src[ 3]));
bool dominantGradient = (DOMINANT_DIRECTION_THRESHOLD * dist_05_03) < dist_04_00;
blendResult[3] = ((dist_04_00 > dist_05_03) && (v[0] != v[5]) && (v[0] != v[3])) ? ((dominantGradient) ? BLEND_DOMINANT : BLEND_NORMAL) : BLEND_NONE;
}
// Pixel Tap Mapping: --|--|22|23|--
// --|06|07|08|09
// --|05|00|01|10
// --|--|03|02|--
// --|--|--|--|--
// Corner (1, 0)
if ( ((v[7] == v[8] && v[0] == v[1]) || (v[7] == v[0] && v[8] == v[1])) == false) {
float dist_00_08 = DistYCbCr(src[ 5], src[ 7]) + DistYCbCr(src[ 7], src[23]) + DistYCbCr(src[ 3], src[ 1]) + DistYCbCr(src[ 1], src[ 9]) + (4.0 * DistYCbCr(src[ 0], src[ 8]));
float dist_07_01 = DistYCbCr(src[ 6], src[ 0]) + DistYCbCr(src[ 0], src[ 2]) + DistYCbCr(src[22], src[ 8]) + DistYCbCr(src[ 8], src[10]) + (4.0 * DistYCbCr(src[ 7], src[ 1]));
bool dominantGradient = (DOMINANT_DIRECTION_THRESHOLD * dist_07_01) < dist_00_08;
blendResult[1] = ((dist_00_08 > dist_07_01) && (v[0] != v[7]) && (v[0] != v[1])) ? ((dominantGradient) ? BLEND_DOMINANT : BLEND_NORMAL) : BLEND_NONE;
}
// Pixel Tap Mapping: --|21|22|--|--
// 19|06|07|08|--
// 18|05|00|01|--
// --|04|03|--|--
// --|--|--|--|--
// Corner (0, 0)
if ( ((v[6] == v[7] && v[5] == v[0]) || (v[6] == v[5] && v[7] == v[0])) == false) {
float dist_05_07 = DistYCbCr(src[18], src[ 6]) + DistYCbCr(src[ 6], src[22]) + DistYCbCr(src[ 4], src[ 0]) + DistYCbCr(src[ 0], src[ 8]) + (4.0 * DistYCbCr(src[ 5], src[ 7]));
float dist_06_00 = DistYCbCr(src[19], src[ 5]) + DistYCbCr(src[ 5], src[ 3]) + DistYCbCr(src[21], src[ 7]) + DistYCbCr(src[ 7], src[ 1]) + (4.0 * DistYCbCr(src[ 6], src[ 0]));
bool dominantGradient = (DOMINANT_DIRECTION_THRESHOLD * dist_05_07) < dist_06_00;
blendResult[0] = ((dist_05_07 < dist_06_00) && (v[0] != v[5]) && (v[0] != v[7])) ? ((dominantGradient) ? BLEND_DOMINANT : BLEND_NORMAL) : BLEND_NONE;
}
vec4 dst[16];
dst[ 0] = src[0];
dst[ 1] = src[0];
dst[ 2] = src[0];
dst[ 3] = src[0];
dst[ 4] = src[0];
dst[ 5] = src[0];
dst[ 6] = src[0];
dst[ 7] = src[0];
dst[ 8] = src[0];
dst[ 9] = src[0];
dst[10] = src[0];
dst[11] = src[0];
dst[12] = src[0];
dst[13] = src[0];
dst[14] = src[0];
dst[15] = src[0];
// Scale pixel
if (IsBlendingNeeded(blendResult) == true) {
float dist_01_04 = DistYCbCr(src[1], src[4]);
float dist_03_08 = DistYCbCr(src[3], src[8]);
bool haveShallowLine = (STEEP_DIRECTION_THRESHOLD * dist_01_04 <= dist_03_08) && (v[0] != v[4]) && (v[5] != v[4]);
bool haveSteepLine = (STEEP_DIRECTION_THRESHOLD * dist_03_08 <= dist_01_04) && (v[0] != v[8]) && (v[7] != v[8]);
bool needBlend = (blendResult[2] != BLEND_NONE);
bool doLineBlend = ( blendResult[2] >= BLEND_DOMINANT ||
((blendResult[1] != BLEND_NONE && !IsPixEqual(src[0], src[4])) ||
(blendResult[3] != BLEND_NONE && !IsPixEqual(src[0], src[8])) ||
(IsPixEqual(src[4], src[3]) && IsPixEqual(src[3], src[2]) && IsPixEqual(src[2], src[1]) && IsPixEqual(src[1], src[8]) && IsPixEqual(src[0], src[2]) == false) ) == false );
vec4 blendPix = ( DistYCbCr(src[0], src[1]) <= DistYCbCr(src[0], src[3]) ) ? src[1] : src[3];
dst[ 2] = mix(dst[ 2], blendPix, (needBlend && doLineBlend) ? ((haveShallowLine) ? ((haveSteepLine) ? 1.0/3.0 : 0.25) : ((haveSteepLine) ? 0.25 : 0.00)) : 0.00);
dst[ 9] = mix(dst[ 9], blendPix, (needBlend && doLineBlend && haveSteepLine) ? 0.25 : 0.00);
dst[10] = mix(dst[10], blendPix, (needBlend && doLineBlend && haveSteepLine) ? 0.75 : 0.00);
dst[11] = mix(dst[11], blendPix, (needBlend) ? ((doLineBlend) ? ((haveSteepLine) ? 1.00 : ((haveShallowLine) ? 0.75 : 0.50)) : 0.08677704501) : 0.00);
dst[12] = mix(dst[12], blendPix, (needBlend) ? ((doLineBlend) ? 1.00 : 0.6848532563) : 0.00);
dst[13] = mix(dst[13], blendPix, (needBlend) ? ((doLineBlend) ? ((haveShallowLine) ? 1.00 : ((haveSteepLine) ? 0.75 : 0.50)) : 0.08677704501) : 0.00);
dst[14] = mix(dst[14], blendPix, (needBlend && doLineBlend && haveShallowLine) ? 0.75 : 0.00);
dst[15] = mix(dst[15], blendPix, (needBlend && doLineBlend && haveShallowLine) ? 0.25 : 0.00);
dist_01_04 = DistYCbCr(src[7], src[2]);
dist_03_08 = DistYCbCr(src[1], src[6]);
haveShallowLine = (STEEP_DIRECTION_THRESHOLD * dist_01_04 <= dist_03_08) && (v[0] != v[2]) && (v[3] != v[2]);
haveSteepLine = (STEEP_DIRECTION_THRESHOLD * dist_03_08 <= dist_01_04) && (v[0] != v[6]) && (v[5] != v[6]);
needBlend = (blendResult[1] != BLEND_NONE);
doLineBlend = ( blendResult[1] >= BLEND_DOMINANT ||
!((blendResult[0] != BLEND_NONE && !IsPixEqual(src[0], src[2])) ||
(blendResult[2] != BLEND_NONE && !IsPixEqual(src[0], src[6])) ||
(IsPixEqual(src[2], src[1]) && IsPixEqual(src[1], src[8]) && IsPixEqual(src[8], src[7]) && IsPixEqual(src[7], src[6]) && !IsPixEqual(src[0], src[8])) ) );
blendPix = ( DistYCbCr(src[0], src[7]) <= DistYCbCr(src[0], src[1]) ) ? src[7] : src[1];
dst[ 1] = mix(dst[ 1], blendPix, (needBlend && doLineBlend) ? ((haveShallowLine) ? ((haveSteepLine) ? 1.0/3.0 : 0.25) : ((haveSteepLine) ? 0.25 : 0.00)) : 0.00);
dst[ 6] = mix(dst[ 6], blendPix, (needBlend && doLineBlend && haveSteepLine) ? 0.25 : 0.00);
dst[ 7] = mix(dst[ 7], blendPix, (needBlend && doLineBlend && haveSteepLine) ? 0.75 : 0.00);
dst[ 8] = mix(dst[ 8], blendPix, (needBlend) ? ((doLineBlend) ? ((haveSteepLine) ? 1.00 : ((haveShallowLine) ? 0.75 : 0.50)) : 0.08677704501) : 0.00);
dst[ 9] = mix(dst[ 9], blendPix, (needBlend) ? ((doLineBlend) ? 1.00 : 0.6848532563) : 0.00);
dst[10] = mix(dst[10], blendPix, (needBlend) ? ((doLineBlend) ? ((haveShallowLine) ? 1.00 : ((haveSteepLine) ? 0.75 : 0.50)) : 0.08677704501) : 0.00);
dst[11] = mix(dst[11], blendPix, (needBlend && doLineBlend && haveShallowLine) ? 0.75 : 0.00);
dst[12] = mix(dst[12], blendPix, (needBlend && doLineBlend && haveShallowLine) ? 0.25 : 0.00);
dist_01_04 = DistYCbCr(src[5], src[8]);
dist_03_08 = DistYCbCr(src[7], src[4]);
haveShallowLine = (STEEP_DIRECTION_THRESHOLD * dist_01_04 <= dist_03_08) && (v[0] != v[8]) && (v[1] != v[8]);
haveSteepLine = (STEEP_DIRECTION_THRESHOLD * dist_03_08 <= dist_01_04) && (v[0] != v[4]) && (v[3] != v[4]);
needBlend = (blendResult[0] != BLEND_NONE);
doLineBlend = ( blendResult[0] >= BLEND_DOMINANT ||
!((blendResult[3] != BLEND_NONE && !IsPixEqual(src[0], src[8])) ||
(blendResult[1] != BLEND_NONE && !IsPixEqual(src[0], src[4])) ||
(IsPixEqual(src[8], src[7]) && IsPixEqual(src[7], src[6]) && IsPixEqual(src[6], src[5]) && IsPixEqual(src[5], src[4]) && !IsPixEqual(src[0], src[6])) ) );
blendPix = ( DistYCbCr(src[0], src[5]) <= DistYCbCr(src[0], src[7]) ) ? src[5] : src[7];
dst[ 0] = mix(dst[ 0], blendPix, (needBlend && doLineBlend) ? ((haveShallowLine) ? ((haveSteepLine) ? 1.0/3.0 : 0.25) : ((haveSteepLine) ? 0.25 : 0.00)) : 0.00);
dst[15] = mix(dst[15], blendPix, (needBlend && doLineBlend && haveSteepLine) ? 0.25 : 0.00);
dst[ 4] = mix(dst[ 4], blendPix, (needBlend && doLineBlend && haveSteepLine) ? 0.75 : 0.00);
dst[ 5] = mix(dst[ 5], blendPix, (needBlend) ? ((doLineBlend) ? ((haveSteepLine) ? 1.00 : ((haveShallowLine) ? 0.75 : 0.50)) : 0.08677704501) : 0.00);
dst[ 6] = mix(dst[ 6], blendPix, (needBlend) ? ((doLineBlend) ? 1.00 : 0.6848532563) : 0.00);
dst[ 7] = mix(dst[ 7], blendPix, (needBlend) ? ((doLineBlend) ? ((haveShallowLine) ? 1.00 : ((haveSteepLine) ? 0.75 : 0.50)) : 0.08677704501) : 0.00);
dst[ 8] = mix(dst[ 8], blendPix, (needBlend && doLineBlend && haveShallowLine) ? 0.75 : 0.00);
dst[ 9] = mix(dst[ 9], blendPix, (needBlend && doLineBlend && haveShallowLine) ? 0.25 : 0.00);
dist_01_04 = DistYCbCr(src[3], src[6]);
dist_03_08 = DistYCbCr(src[5], src[2]);
haveShallowLine = (STEEP_DIRECTION_THRESHOLD * dist_01_04 <= dist_03_08) && (v[0] != v[6]) && (v[7] != v[6]);
haveSteepLine = (STEEP_DIRECTION_THRESHOLD * dist_03_08 <= dist_01_04) && (v[0] != v[2]) && (v[1] != v[2]);
needBlend = (blendResult[3] != BLEND_NONE);
doLineBlend = ( blendResult[3] >= BLEND_DOMINANT ||
!((blendResult[2] != BLEND_NONE && !IsPixEqual(src[0], src[6])) ||
(blendResult[0] != BLEND_NONE && !IsPixEqual(src[0], src[2])) ||
(IsPixEqual(src[6], src[5]) && IsPixEqual(src[5], src[4]) && IsPixEqual(src[4], src[3]) && IsPixEqual(src[3], src[2]) && !IsPixEqual(src[0], src[4])) ) );
blendPix = ( DistYCbCr(src[0], src[3]) <= DistYCbCr(src[0], src[5]) ) ? src[3] : src[5];
dst[ 3] = mix(dst[ 3], blendPix, (needBlend && doLineBlend) ? ((haveShallowLine) ? ((haveSteepLine) ? 1.0/3.0 : 0.25) : ((haveSteepLine) ? 0.25 : 0.00)) : 0.00);
dst[12] = mix(dst[12], blendPix, (needBlend && doLineBlend && haveSteepLine) ? 0.25 : 0.00);
dst[13] = mix(dst[13], blendPix, (needBlend && doLineBlend && haveSteepLine) ? 0.75 : 0.00);
dst[14] = mix(dst[14], blendPix, (needBlend) ? ((doLineBlend) ? ((haveSteepLine) ? 1.00 : ((haveShallowLine) ? 0.75 : 0.50)) : 0.08677704501) : 0.00);
dst[15] = mix(dst[15], blendPix, (needBlend) ? ((doLineBlend) ? 1.00 : 0.6848532563) : 0.00);
dst[ 4] = mix(dst[ 4], blendPix, (needBlend) ? ((doLineBlend) ? ((haveShallowLine) ? 1.00 : ((haveSteepLine) ? 0.75 : 0.50)) : 0.08677704501) : 0.00);
dst[ 5] = mix(dst[ 5], blendPix, (needBlend && doLineBlend && haveShallowLine) ? 0.75 : 0.00);
dst[ 6] = mix(dst[ 6], blendPix, (needBlend && doLineBlend && haveShallowLine) ? 0.25 : 0.00);
}
// select output pixel
vec4 res = mix(mix(mix(mix(dst[ 6], dst[ 7], step(0.25, f.x)),
mix(dst[ 8], dst[ 9], step(0.75, f.x)),
step(0.50, f.x)),
mix(mix(dst[ 5], dst[ 0], step(0.25, f.x)),
mix(dst[ 1], dst[10], step(0.75, f.x)),
step(0.50, f.x)),
step(0.25, f.y)),
mix(mix(mix(dst[ 4], dst[ 3], step(0.25, f.x)),
mix(dst[ 2], dst[11], step(0.75, f.x)),
step(0.50, f.x)),
mix(mix(dst[15], dst[14], step(0.25, f.x)),
mix(dst[13], dst[12], step(0.75, f.x)),
step(0.50, f.x)),
step(0.75, f.y)),
step(0.50, f.y));
return res;
}
uint applyScalingu(uvec2 origxy, uvec2 xy) {
return packUnorm4x8(applyScalingf(origxy, xy));
}

View File

@@ -0,0 +1,117 @@
/* MMPX.glc
Copyright 2020 Morgan McGuire & Mara Gagiu.
Provided under the Open Source MIT license https://opensource.org/licenses/MIT
See js-demo.html for the commented source code.
This is an optimized GLSL port of that version
by Morgan McGuire and Mara Gagiu.
*/
#define ABGR8 uint
ABGR8 src(int x, int y) {
return readColoru(uvec2(clamp(x, 0, params.width - 1), clamp(y, 0, params.height - 1)));
}
uint luma(ABGR8 C) {
uint alpha = (C & 0xFF000000u) >> 24;
return (((C & 0x00FF0000u) >> 16) + ((C & 0x0000FF00u) >> 8) + (C & 0x000000FFu) + 1u) * (256u - alpha);
}
bool all_eq2(ABGR8 B, ABGR8 A0, ABGR8 A1) {
return ((B ^ A0) | (B ^ A1)) == 0u;
}
bool all_eq3(ABGR8 B, ABGR8 A0, ABGR8 A1, ABGR8 A2) {
return ((B ^ A0) | (B ^ A1) | (B ^ A2)) == 0u;
}
bool all_eq4(ABGR8 B, ABGR8 A0, ABGR8 A1, ABGR8 A2, ABGR8 A3) {
return ((B ^ A0) | (B ^ A1) | (B ^ A2) | (B ^ A3)) == 0u;
}
bool any_eq3(ABGR8 B, ABGR8 A0, ABGR8 A1, ABGR8 A2) {
return B == A0 || B == A1 || B == A2;
}
bool none_eq2(ABGR8 B, ABGR8 A0, ABGR8 A1) {
return (B != A0) && (B != A1);
}
bool none_eq4(ABGR8 B, ABGR8 A0, ABGR8 A1, ABGR8 A2, ABGR8 A3) {
return B != A0 && B != A1 && B != A2 && B != A3;
}
uint applyScalingu(uvec2 origxy, uvec2 xy) {
int srcX = int(origxy.x);
int srcY = int(origxy.y);
ABGR8 A = src(srcX - 1, srcY - 1), B = src(srcX, srcY - 1), C = src(srcX + 1, srcY - 1);
ABGR8 D = src(srcX - 1, srcY + 0), E = src(srcX, srcY + 0), F = src(srcX + 1, srcY + 0);
ABGR8 G = src(srcX - 1, srcY + 1), H = src(srcX, srcY + 1), I = src(srcX + 1, srcY + 1);
ABGR8 J = E, K = E, L = E, M = E;
if (((A ^ E) | (B ^ E) | (C ^ E) | (D ^ E) | (F ^ E) | (G ^ E) | (H ^ E) | (I ^ E)) != 0u) {
ABGR8 P = src(srcX, srcY - 2), S = src(srcX, srcY + 2);
ABGR8 Q = src(srcX - 2, srcY), R = src(srcX + 2, srcY);
ABGR8 Bl = luma(B), Dl = luma(D), El = luma(E), Fl = luma(F), Hl = luma(H);
// 1:1 slope rules
if ((D == B && D != H && D != F) && (El >= Dl || E == A) && any_eq3(E, A, C, G) && ((El < Dl) || A != D || E != P || E != Q)) J = D;
if ((B == F && B != D && B != H) && (El >= Bl || E == C) && any_eq3(E, A, C, I) && ((El < Bl) || C != B || E != P || E != R)) K = B;
if ((H == D && H != F && H != B) && (El >= Hl || E == G) && any_eq3(E, A, G, I) && ((El < Hl) || G != H || E != S || E != Q)) L = H;
if ((F == H && F != B && F != D) && (El >= Fl || E == I) && any_eq3(E, C, G, I) && ((El < Fl) || I != H || E != R || E != S)) M = F;
// Intersection rules
if ((E != F && all_eq4(E, C, I, D, Q) && all_eq2(F, B, H)) && (F != src(srcX + 3, srcY))) K = M = F;
if ((E != D && all_eq4(E, A, G, F, R) && all_eq2(D, B, H)) && (D != src(srcX - 3, srcY))) J = L = D;
if ((E != H && all_eq4(E, G, I, B, P) && all_eq2(H, D, F)) && (H != src(srcX, srcY + 3))) L = M = H;
if ((E != B && all_eq4(E, A, C, H, S) && all_eq2(B, D, F)) && (B != src(srcX, srcY - 3))) J = K = B;
if (Bl < El && all_eq4(E, G, H, I, S) && none_eq4(E, A, D, C, F)) J = K = B;
if (Hl < El && all_eq4(E, A, B, C, P) && none_eq4(E, D, G, I, F)) L = M = H;
if (Fl < El && all_eq4(E, A, D, G, Q) && none_eq4(E, B, C, I, H)) K = M = F;
if (Dl < El && all_eq4(E, C, F, I, R) && none_eq4(E, B, A, G, H)) J = L = D;
// 2:1 slope rules
if (H != B) {
if (H != A && H != E && H != C) {
if (all_eq3(H, G, F, R) && none_eq2(H, D, src(srcX + 2, srcY - 1))) L = M;
if (all_eq3(H, I, D, Q) && none_eq2(H, F, src(srcX - 2, srcY - 1))) M = L;
}
if (B != I && B != G && B != E) {
if (all_eq3(B, A, F, R) && none_eq2(B, D, src(srcX + 2, srcY + 1))) J = K;
if (all_eq3(B, C, D, Q) && none_eq2(B, F, src(srcX - 2, srcY + 1))) K = J;
}
} // H !== B
if (F != D) {
if (D != I && D != E && D != C) {
if (all_eq3(D, A, H, S) && none_eq2(D, B, src(srcX + 1, srcY + 2))) J = L;
if (all_eq3(D, G, B, P) && none_eq2(D, H, src(srcX + 1, srcY - 2))) L = J;
}
if (F != E && F != A && F != G) {
if (all_eq3(F, C, H, S) && none_eq2(F, B, src(srcX - 1, srcY + 2))) K = M;
if (all_eq3(F, I, B, P) && none_eq2(F, H, src(srcX - 1, srcY - 2))) M = K;
}
} // F !== D
} // not constant
// TODO: Write four pixels at once. For now, 1/4x speed.
if ((xy.y & 1u) == 0u) {
if ((xy.x & 1u) == 0u) {
return J;
}
return K;
}
if ((xy.x & 1u) == 0u) {
return L;
}
return M;
}
vec4 applyScalingf(uvec2 origxy, uvec2 xy) {
return unpackUnorm4x8(applyScalingu(origxy, xy));
}

View File

@@ -1,3 +1,8 @@
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
attribute vec4 a_position;
attribute vec2 a_texcoord0;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB