Cemu icon indicating copy to clipboard operation
Cemu copied to clipboard

Cemu 2.0 - BoTW: Graphic Pack, Clarity Enhacement, presets don't work with linux native.

Open joao-pedro-barbosa opened this issue 3 years ago • 4 comments

Hi.

I'm running version 2, under last linux native version and I noticed Zelda BOTW graphic pack "Enhacement", Clarity presets don't work. It does on windows version, but no on new 2.0 on linux native binary.

My setup is Intel i5-11400f 16G RAM DDR4 Gigabyte GTX 1060 6GB DDR5

The game I'm running is The legend of Zelda - BOTW 1.5

Thanks!

joao-pedro-barbosa avatar Oct 18 '22 13:10 joao-pedro-barbosa

presets should work as of latest code, compile latest or use the experimental ubuntu release.

Squall-Leonhart avatar Oct 18 '22 13:10 Squall-Leonhart

Sorry. Maybe it's my fault. I'm not able to see the difference now.

joao-pedro-barbosa avatar Oct 18 '22 17:10 joao-pedro-barbosa

Can we reopen this issue? I just tested this on latest master and BoTW Clarity still doesn't work correctly. Most if not all shader based graphic packs do not seem work on linux native (both opengl and vulkan), while fps++ and resolution changes work just fine.

I am aware of #375 but it seems to me that this issue is caused by the graphic pack shader code not working correctly rather than crc errors.

gurrgur avatar Oct 19 '22 16:10 gurrgur

Of course yes!

joao-pedro-barbosa avatar Oct 19 '22 16:10 joao-pedro-barbosa

Can repro on latest ffa213c. Clarity presets don't work. Didn't notice before because I don't use them.

OS: Fedora 36 GPU: NVIDIA GeForce GTX 1050 Ti Driver version: 520.56.06 Game: Breath of the Wild (EU, v208 / 1.5.0)

log-filmic.txt

jn64 avatar Oct 22 '22 15:10 jn64

And here I naively thought that they just that "subtle"… until I watched a comparison video, so no presets for me either. Would really go for some more contrast and less default wash-out.

v-fox avatar Oct 24 '22 20:10 v-fox

@v-fox You can use vkBasalt with some known working shaders in the meantime.

(random example, obviously can be tweaked better) montage

jn64 avatar Oct 25 '22 06:10 jn64

You can use vkBasalt with some known working shaders in the meantime.

I'm using it… but for SMAA+CAS which makes it smooooth as hell. But Reshade support in it is half-baked and experimental. While BOTW Reshade workaround pack says that they need to have depth buffer forcibly enabled for it to work which in turn causes nasty geometry flickering artefacts. So, making it decent is a project in itself.

v-fox avatar Oct 25 '22 06:10 v-fox

Simple colour/contrast-related shaders usually don't use depth buffer. In above example, BotW Reshade workaround is disabled, and depthCapture = off in vkBasalt.conf.

Although at that point, you could also just change monitor/GPU settings (I forgot about it, but I should bump up Nvidia's Digital Vibrance more for BotW).

jn64 avatar Oct 25 '22 08:10 jn64

Simple colour/contrast-related shaders usually don't use depth buffer. In above example, BotW Reshade workaround is disabled, and depthCapture = off in vkBasalt.conf. Although at that point, you could also just change monitor/GPU settings (I forgot about it, but I should bump up Nvidia's Digital Vibrance more for BotW).

Well, you've convinced me. Maybe this is even better than dubious presets with a ton of changes of questionable necessity.

So, for reference I've dusted off my old ReShade preset for NieR: Automata installation on Windows and dug out cemu's preset file (~/.local/share/Cemu/graphicPacks/downloadedGraphicPacks/BreathOfTheWild/Enhancements/37040a485a29d54e_00000000000003c9_ps.txt). But, since my simple VA-monitor is calibrated for "the standard" sRGB/200nit/1:3000/6500K output, I've decided not to screw with colours and ended up with a simple configuration of smaa:cas:Clarity:FakeHDR for now.

Specifically:
  • vkBasalt.conf
effects = smaa:cas:ReClarity:ReFakeHDR
# working paths while vkBasalt-working-reshade-shaders dir is in ~/.config/vkBasalt/
ReClarity = vkBasalt-working-reshade-shaders/allshaders/reshade-shaders-working/Shaders/Clarity.fx
ReFakeHDR = vkBasalt-working-reshade-shaders/allshaders/reshade-shaders-working/Shaders/FakeHDR.fx
reshadeTexturePath = vkBasalt-working-reshade-shaders/allshaders/reshade-shaders-working/Textures
reshadeIncludePath = vkBasalt-working-reshade-shaders/allshaders/reshade-shaders-working/Shaders
depthCapture = on
casSharpness = 0.111
smaaEdgeDetection = color
smaaThreshold = 0.04
smaaMaxSearchSteps = 48
smaaMaxSearchStepsDiag = 16
smaaCornerRounding = 66
  • Clarity.fx:
ClarityOffset = 1.0
ClarityBlendMode = 5
ClarityBlendIfDark = 33
ClarityBlendIfLight = 222
  • FakeHDR.fx
HDRPower = 1.25
radius1 = 0.87
radius2 = 0.93

v-fox avatar Oct 25 '22 12:10 v-fox

Okay, so I found the cause of this issue!

It is caused by compiler discrepancies for printf formatting. Cemu uses %I64x for reading the shader base and aux hash from the filename which does not work on linux.

Here is a related stackoverflow answer where they suggest replacing %I64x with %llx which solves the issue for me.

They also suggest creating a preprocessor constant to switch between both variants depending on the platform.

gurrgur avatar Oct 25 '22 14:10 gurrgur

Hi. First of all. Thanks for your effort. I test it, and it seems Clarity preset is applied, but with some glitches for me. Anyone can test it?

2022-10-26 11 50 10

Only glitches with vulkan! OpenGL is working ok (but slow for me).

joao-pedro-barbosa avatar Oct 26 '22 09:10 joao-pedro-barbosa

I only tested briefly but no glitches here. My settings are the same as my earlier log. Can't try to repro if you don't include logs.

jn64 avatar Oct 26 '22 11:10 jn64

You have reason @jn64. Here's the mine.

OS: batocera x86_64 - 36-dev-58295d08ed CPU: Intel i5-11400F RAM: 16G RAM DDR4 GPU: Gigabyte GTX 1060 6GB DDR5 Driver version: 520.56.06 Game: Breath of the Wild (EU, v208 / 1.5.0)

cemu-log-contrasty.txt I think with linux version and vulkan is enough to reproduce, because with last linux binary and opengl all works fine.

Thanks!

joao-pedro-barbosa avatar Oct 26 '22 13:10 joao-pedro-barbosa

I tried with identical settings as you and didn't get any glitches or errors. log2.txt

There is this error throughout your log:

GLSL parsing failed for 3a11595b2bcc1e76_00000000ffffffff: "ERROR: 0:183: 'limitations' : Non-constant-index-expression
ERROR: 0:184: 'limitations' : Non-constant-index-expression

which is from https://github.com/cemu-project/Cemu/blob/d6ba61cf6435a163bf6aea17de32c19d1e61e456/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp#L340

jn64 avatar Oct 27 '22 03:10 jn64

@jn64 today's binary is ok with vulkan. Maybe the yesterday generated binary has just a partial solution. Thanks to everyone! @v-fox @gurrgur @jn64 @Squall-Leonhart

joao-pedro-barbosa avatar Oct 27 '22 06:10 joao-pedro-barbosa