Shader pass to render output for vertical/tate games

Hi, been a while since I was active here but always been lurking around, great to see the continous progress on all these shaders here and what you guys are achieving :+1:

Just a quick question, maybe for the expert shader coders out there, is it possible (if it’s not already been done) to have a single shader pass that can be appended to a shader chain that simply rotates the shader effect for a tate output e.g. if you are playing the game Mr. Do, Donkey Kong, Mercs etc… which are 3:4 aspect ratio in MAME with any shader like easymode-halation.slangp or crt-consumer.slangp and append a last shader pass which simply rotates the previous shader effects 90 degrees (even better have parameters allowing one to rotate on/off, 90, 180, 270 etc…) so the scanlines switch to render vertically and masks horizontally?

Or is it more complex than that and cannot be achieved with a simple with a shader pass?

Any scaling that happens after a CRT effect makes masks and scanlines look wonky

In my experimenting point scaling to 2x viewport resolution (stock shader), rotating and downsampling (linear) gives acceptable results, better as rotating at 1x viewport regarding masks and scanlines.

Perhaps @HyperspaceMadness or @kokoko3k could contribute an aspect equipped rotating pass…

These shaders are all simple and the composition shouldn’t have a devastating impact on performance with discrete gpus.

1 Like

yeah, rotating before the CRT effect should be fine.

1 Like

Maybe I’m missing something, but wouldn’t this rotate the game image as well?

Unless the idea is you rotate before the crt pass, then you rotate again after the crt pass… You’d have to do something like that for Mame current which outputs a vertical aspect image for a vertical game.

2 Likes

Eh, you are right, i guess i had a FBNeo situation in mind. Still works quite nicely, better then the default HW rotation.

I second HSM, it is not 100% clear to me if the intended effect is to see the game rotated and the scanlines in place.

It could be a legit use case, there are lcd displays that can be phisycally rotated with ease :slight_smile:

1 Like

Thanks for the input guys, the intention is just to rotate the shader effect the core output stays as it is, pretty much similar to the TATE toggle the GDV advance shader has when applied to any running game.

1 Like

I admit i’m not sure I understood what is the use case here, but still the only solution i can think of are 2 passes, as already suggested, 1 that rotates before everything, one that 'de’rotates after everything.

Problem is that masks are drawn on screen coordinates so that they can lineup perfectly with real pixel screen.

As hunterk said, rotating after those effects are applied would ruin everything, so a catch-all/general solution wouldn’t be really possilbe.

Why don’t you use a shader that supports tate natively or maybe a core that pre rotates vertical games instead?

1 Like

Yes, I could use a CRT shader with TATE already baked into the code, there are a only a handful of CRT shaders that have a TATE toggle.

I was thinking it would be cool if a shader pass be added to any CRT shader chain that didn’t have the TATE ability and allowed you to rotate it’s scanlines/masks to work with vertical/TATE games.

Maybe it is more complex than my initial thought.

2 Likes

Since this PR, it’s entirely possible for a shader to know and adapt for the libretro rotation index, however it doesn’t solve the problem of mame/mame2016 cores being the 2 only arcade cores missing that libretro rotation implementation.

2 Likes

Not entirely sure how this helps what I was hoping to achieve, it’s a bit over my head as I am not very technical. However, sounds promising that the shader model within retroarch is being looked at for a more seamless integration with tate/vertical orientated games.