cemu-project / cemu_graphic_packs

Community Graphic Packs for Cemu
https://cemu-project.github.io/cemu_graphic_packs/
Creative Commons Zero v1.0 Universal
1.32k stars 588 forks source link

Xenoblade Chronicles X #132

Closed getdls closed 6 years ago

getdls commented 7 years ago

On hold, waiting for Cemu texture rewrite 1.4~1.5 to stabilize. If brightness and alignment are fixed, about half of the shaders will need to be removed/updated

XCX stopped crashing in cemu, so I got around to fixing some stuff.. and noted that there are still some other issues.

http://compat.cemu.info/wiki/Xenoblade_Chronicles_X

21:9 GUI fix issues

Cemuhook patches - 60 fps / AMD brightness / offline tag / 21_9

To do

//uf_remappedVS[0].x == {1065353216, 1065353216} //metal back 
//uf_remappedPS[0] {1064030938, 1065353216, 1064304640, 1023410176} //  indoors

//uf_remappedVS[0].x == {1065353216, 1065353216} //dayligh plain
//uf_remappedPS[0] {1075838976, 10653532216, 1064304640, 1023410176} // daylight plain

//uf_remappedVS[0].x == {1065353216, 1065353216} //night forest
//uf_remappedPS[0] {1075838976, 10653532216, 1064304640, 1023410176} // night forest 

xcxfixes

153

ActualMandM commented 7 years ago

i looked into the zip and converted it to the build script format, hopefully i didn't mess anything up XenobladeX.zip

getdls commented 7 years ago

Cheers Slashie

Stasis and B&W videos fixed,

[TextureRedefine] # game rendering resolution.  #Change this value
width = 1280
height = 720
tileModesExcluded = 0x001
#formatsExcluded = 0x001 #FMV starfield  
...
[TextureRedefine] # Party/Bestiary/Menu Screens. FMV buffer
width = 1024
height = 720
formatsExcluded = 0x001 #stasis fix. (movie)    
getdls commented 7 years ago

Well that was obvious now that I stop and think about it..

failbokeh

morefails

getdls commented 7 years ago

uh. oh... um.. looks like I'm commiting to an old branch!?.. figure this out tomorrow..

edit oh crap, there's a widescreen patch for Xenoblade!? separate <?=$scaleFactorY?>; will be added to commit (It still fixes stuff.. but i guess its 2.370:1 /1.77:1 % worse looking ;)

@slashiee is there an appveryor expermental builds link to check the final result?

getdls commented 7 years ago

21:9 Gui and some minor in-game fixes. Note, this is not the general shader scaling fix, just the GUI https://github.com/slashiee/cemu_graphic_packs/commit/b521212b3fb83c51a33f607b9390d3fdee6b2073

21gui

Crementif commented 7 years ago

I just want to mention (besides the files where you've commented this) that this does increase the amount of passes, which could decrease performance (getdls already knows this) but just wanna share that with however reads this. I'm interested in seeing it updated, good work!

zerocold1981 commented 7 years ago

screenshot on AMD polaris cards it's impossible to play yet ...

getdls commented 7 years ago

Can you test the three versions below? Please also check night, its possible any daylight fix will make night unplayable on Polaris..

Gutted should tell us if its broken before the grading shader Grading only should tell us if exposure part is wrong Halved should tell us if its any use going after the exposure at all.

OnlyGrade_XenobladeX_1440p.zip Gutted_XenobladeX_1440p.zip Halved_Exp_XenobladeX_1440p.zip

I'd expect grading only to look something like this during daytime: off

zerocold1981 commented 7 years ago

OnlyGrade_XenobladeX_DAY / NIGHT onlygrade_xenobladex_day onlygrade_xenobladex_night Gutted_XenobladeX_1440_Black screen all time gutted_xenobladex Halved_Exp_XenobladeX_DAY / NIGHT halved_exp_xenobladex_day halved_exp_xenobladex_night

thanks, the third option allows me to play)

Of course, this is far from comfort, but what can you do, the driver polaris is just an infernal thing

getdls commented 7 years ago

@zerocold1981 I've added a tweak where shadows contribute more "shade" to the overall scene exposure. It lessens more of daylight and less of night. Could you try this one, and maybe tweak the value up and down a bit?

It won't fix the issue by it self, but combining it with the brightness tweak should lead to less extreme values.

const float shadowExposure = 0.75; // tweakable value in the header of the shader 0.1 ->1.0 less exposure. XenobladeX_HighResShadows.zip

zerocold1981 commented 7 years ago

unfortunately there is no effect. Even with a value of 2.0. I just did not see any changes. Probably does not work on polaris

getdls commented 7 years ago

Values below 1.0 (0.3 example) should have decreased brightness. Anything above 1.0 should have made the problem even worse. Well other than tweaking Halved_Exp_XenobladeX_DAY / NIGHT up or down a bit, I'm out of ideas :/ edit There's possible a conflict if you're combining it with the other graphics pack, it has the same shadow shaders.

zerocold1981 commented 7 years ago

0.3 861664cf

1.0 screenshot

0.10 screenshot

zerocold1981 commented 7 years ago

0.10 + Halved_Exp_XenobladeX_DAY screenshot

0.10 + Halved_Exp_XenobladeX_NIGHT screenshot

getdls commented 7 years ago

Alright, so it does work.. I'd stick with values around 0.4 to 0.6 or you won't have any normal shadows left... This one contains both shadow tweak at .5 and "brightness" fix with similar settings. in File 3cc7e98f78c258b4_00000000000003ca_ps.txt

See if you can dial in something by increasing pre-exposure to ok levels, and then dial back bloom Its the same as before, values below 1 decreases. Gamma is the last part, it decreases or increases overall contrast (well close enough..)

const float preExposure = 0.55; // overall brigtness, around .4 for AMD
const float bloomExposure = 0.3; // How much we blend the other parts of the shaders
const float gammaPostExposure = 0.9; // compensate pre exposure, but loss of contrast when positive. 

XenobladeX_1440p.zip

zerocold1981 commented 7 years ago

DAY, very good screenshot NIGHT, very good!!! screenshot

Thank you very much friend, this is a very big job for me !!!

before that I used the schedule from here: https://www.reddit.com/r/cemu/comments/5uv91b/massive_graphic_pack_for_xcx_13_gfx_settings_5/ He was the best, but now outdated. Thanks again, I really appreciate it.

getdls commented 7 years ago

I'm glad it worked. If you find a good brightness / shadow setting after some tweaking, please post the values. As I haven't got an AMD card, its all guesswork for me.

Crementif commented 7 years ago

Gamepad isn't scaled yet (according to Hdoge#6924) for some reason like all/most other packs. This causes the probe menu on the gamepad to be hidden. I can't test this myself, but I'm pretty sure it should be enabled by default. Here's the fix (thanks Snorgrind#3134) if you want to include this.

[TextureRedefine] # gamepad
width = 854
height = 480
overwriteWidth = <?=round($scaleFactorX*854)?>
overwriteHeight = <?=round($scaleFactorY*480)?>
getdls commented 7 years ago

Thanks, should be fixed in the next commit. Reminder to self, check 21:9 scaling before sync

Fixed, https://github.com/slashiee/cemu_graphic_packs/commit/61bf0415c705bf460246861a0369853c53462938 Still need to check 21:9..

getdls commented 6 years ago

I guess that subtraction part was there for a reason... should probably fix that before committing.

moarbloooom

getdls commented 6 years ago

That's more like it :) awalkinthepark

jhonyndx commented 6 years ago

Hey guys, i play on 21:9 and its amazing with the current 2d and GUI fix, but the only thing that interferes in play, is that the gamepad scales with the main game window, thes no way we can just ignore the effects os GUI fiz on gamepad screen?

Crementif commented 6 years ago

Hey,

Could you elaborate your problem please, it's not very clear. Including screenshots with some notes on it definitely helps us understand.

ActualMandM commented 6 years ago

i think he's talking about the gamepad being stretched

getdls commented 6 years ago

edit The gamepad is scaled to 21;9 (2d 16:9 "pillar boxed"), note aspect ratio of circular city. However the clickable area is unscaled. ie corner clicks register towards the centre (red arrow).

I blame cemu/21:9 patch for this one ;). VS edit can't re position touch, only where the icon lights up. Leaving map unscaled will break all of the other dialog boxes in-game.

Also noted some issues with car lights and mist, those I can do something about.

21aspect2sensoroff

jhonyndx commented 6 years ago

Oh sorry if i wasn't clear, but its exactly what you said @getdls, if you click the red area 1 in the print below, it will hit the blue area 2, it will be inverted in the other side ( area 3 and 4) and will be okay in the center, so the click areas are aligned with the resolution 21:9 but the image itself isn't. So before i said if there's anyway to ignore the 21:9GUI pack effects in the gamepad view, since the clickable area its OK when only 21:9 is active.

capturar

getdls commented 6 years ago

Fixed some more 21:9 stuff, https://github.com/slashiee/cemu_graphic_packs/commit/c9305b4b9d3a0189fe8795b41725c4afbb35f820 but I can't do anything about the touch area.

Crementif commented 6 years ago

Quoting Rajkosto here, but he said that the touch area is caused by using wrong deprojection matrix. Not really sure if it's any different from other games.

jhonyndx commented 6 years ago

Understood, since the touch is for fast travel, its easy to get used, thanks for everything you all have done, playing on ultrawide is awesome.

jhonyndx commented 6 years ago

Since i have no problems with menus or texts scaled with 21:9, i tried to find what is making gamepad screen like that, and is this guy down here:

capturar3

Sacrificing the effects above, i keep the menus, dialog boxes and texts scaled to 21:9 (not so ugly) and keep the tower count, party and npc's skells lights, gamepad screen, transporter flare effects, and other things working properly, its a nice price to pay. Dunno what to say about that shooting flash in the gamescreen below.

capturar4

There's my GUI graphic pack folder

XenobladeX_219_GUI.zip

getdls commented 6 years ago

That's a good idea, how about attaching the changes in a zip file? Just edit your message and do a drag n drop.

Xalphenos commented 6 years ago

I could maybe fix that effect. There was an aspect calculation I left unmodified. I couldn't find any difference that it made but I was still early in the game and didn't have much use for the gamepad screen. But it seems recent packs don't scale the gamepad like they used to?

I was able to fix the similar issue in SM3DW at any rate.

getdls commented 6 years ago

Xalphenos, that would be great. Any chance you could take a stab at Wind waker as well? Same issue...

But it seems recent packs don't scale the gamepad like they used to?

Dunno about other packs, but I had to scale one gl_depth to fix text, maps, and a buch of 2d fx , and since its shaders changes all cascade leading to the next fix... and so on. Doing it directly in the patch probably would have made all of the game changes redundant.

Xalphenos commented 6 years ago

What version of the graphics pack do I need to not stretch the gamepad screen back out? And yeah I could look into WW as well. That one may be odd. I remember the aspect ratio wasn't calculated in that game it was just there as a rodata constant. But yeah I'll look into it.

getdls commented 6 years ago

Latest commit graphicPacks_2-575, any 219 . (XenobladeX_2880p219)

Just out of curiosity, why wouldn't the controlpad touch area always be constant for all games? (ie the actual touch sensor aspect)

Xalphenos commented 6 years ago

Don't know what I may be missing but gamepad is stretched for me. Not pillarboxed like the previous pics. Does the scaling not work on amd gpu?

Some games calculate aspects and some don't.

getdls commented 6 years ago

checking WTF happened!? Must have ***** something.. brb

DOH changes are in the work-around folder XenobladeX_219_GUI, also in the commit XenobladeX_2880p219 only contains the base game fixes

Xalphenos commented 6 years ago

Ah I see now. I should have noticed that folder before I guess.

getdls commented 6 years ago

Considering I did the commit.. that makes us two ;) It's like you get a brain reset when you switch between projects..

getdls commented 6 years ago

Since the AppVeyor PHP drives me nutty I bashed together a log.txt to rule converter edit v1.2 -> 0.0.. values managed. v1.3 Lodbias and colour header, exclude suggestions for textures v1.5 Match formats to viewports rulesGenv1_5.zip

Usage: >rulesGen | rulesGen <multiple>

rulesGen 3.75 Looks for log.txt in local folder and generates rules.txt with 3.75x scaling and gitRules.txt with php tags

No error handling what-so-ever. if log.txt is missing or locked, program will just barf.. and it probably needs updated .net libraries.

Crementif commented 6 years ago

Sounds useful! But what does the log.txt contain exactly? Does it work like that Cemu Viewport Finder program which used Cemu's logging feature?

getdls commented 6 years ago

Probably the same approach, scans cemu log.txt for GX2SetScissor and builds a rule.txt file from last two positions

[00:44:46] GX2SetScissor(0, 0, 320, 176) -> 
[TextureRedefine]
width = 320
height = 176

If they match, TextureRedefine block is commented out with a #possible texture, check rules (0x005) note

Other than that it's mostly a horrendous hack to build the php header

getdls commented 6 years ago

New "brightness" pre-set https://github.com/slashiee/cemu_graphic_packs/commit/4fa595b430054b406f585ec9a2de4a73066f0e52 , opening scene is still awesome :)

xcx1

xcx3

JamieeLee commented 6 years ago

well hello there beautiful , there it starting to look like sexy goodness.

getdls commented 6 years ago

@JamieeLee XCX clarity, what about sticking it in the AA shader like the old BOTW version?

Combine it with exposure fix https://github.com/slashiee/cemu_graphic_packs/commit/4fa595b430054b406f585ec9a2de4a73066f0e52 but set it to netutral? [0.55 pre ex, 1.05 post, all contrasty settings to 1 or 0]

The pack below has higher priority than both AA fix and brightness fix. Xenoblade-Clarity.zip

JamieeLee commented 6 years ago

Sorry for the late replay , damn github didn't tell me you replied , we can merge em I do not mind at all I would rather have one shader that does it since no one else seems to be doing gfx packs.. It would prob be the time to do it since I am going to rewrite the whole shader anyways and add more stuff so if you want me to include it I can.. @getdls

getdls commented 6 years ago

I’ve tested some more presets in the AA shader and since then and didn’t like the results. It always ends up too dark, or can’t restore any overbloom. Clarity probably needs the brightness shader for some of the effects.

Sharpen and similar works as expected, others probably not

getdls commented 6 years ago

RulesGen v1.5 rulesGenv1_5.zip Now checks for formats in \dump\shaders \dump\textures matching texture format to rules.txt viewports

If shaders/textures folders are empty functionality is the same as previous version

Don't forget clear shader//texture dump when switching between games or the wrong formats will be matched to the viewport rules

getdls commented 6 years ago

Close and commit still isn't comment...

JamieeLee commented 6 years ago

@getdls Hey for the exposure issue could we try something like this .

define SAMPLE_COUNT 9

static unsigned int Pixels[SAMPLE_COUNT][2] = {
iWidth0.50, iHeight0.50,

iWidth*0.25, iHeight*0.50,
iWidth*0.75, iHeight*0.50,
iWidth*0.50, iHeight*0.25,
iWidth*0.50, iHeight*0.75,

iWidth*0.25, iHeight*0.25,
iWidth*0.25, iHeight*0.75,
iWidth*0.75, iHeight*0.25,
iWidth*0.75, iHeight*0.75

};

Vector3D kAveragedSamples; unsigned char Samples[SAMPLE_COUNT][4]; for( unsigned int i = 0; i < SAMPLE_COUNT; i++ ) { glReadPixels( Pixels[i][0], Pixels[i][1], 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &Samples[i][0] ); kAveragedSamples += ( Vector3D(Samples[i][0], Samples[i][1], Samples[i][2])/255.0f )/SAMPLE_COUNT; }

AverageBrightness = max( max(kAveragedSamples.x, kAveragedSamples.y), kAveragedSamples.z );

fExposure = 0.5/AverageBrightness; fExposure = fPreviousExposure+( fExposure-fPreviousExposure )*0.02;

fPreviousExposure = fExposure;

or at the end . TargetExposure = 0.5 / Average_Brightness; Exposure = Exposure + (TargetExposure - Exposure) * 0.1;