Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cocktail cabinet - no rotation #3

Open
CaptCraiger opened this issue Aug 29, 2016 · 17 comments
Open

Cocktail cabinet - no rotation #3

CaptCraiger opened this issue Aug 29, 2016 · 17 comments

Comments

@CaptCraiger
Copy link

Is it possible to change the cocktail shader to not rotate the game? My Pi is already setup in portrait mode and doesn't need the rotation. Thank you!

@hizzlekizzle
Copy link
Collaborator

You still want to rotate one of the game images, though, right?

@CaptCraiger
Copy link
Author

Yes. One turned 180 degrees a on top of the other.

@hizzlekizzle
Copy link
Collaborator

I made a Cg version and uploaded it to the common-shaders repo. Once it gets auto-converted to GLSL, I'll come back to it and add the runtime parameters and push it up to this repo.

@CaptCraiger
Copy link
Author

Where does the auto-converter version get sent to?

@hizzlekizzle
Copy link
Collaborator

It goes into the online updater, under 'update glsl shaders'. It's there now, so I'll try to get the parameters in tomorrow and post it here.

@hizzlekizzle
Copy link
Collaborator

hizzlekizzle commented Sep 6, 2016

Alright, here you go:
https://github.com/hizzlekizzle/glsl-shaders/blob/master/misc/cocktail-cab-portrait.glsl
Let me know how it treats you.

It should get pulled into the online updater in a few minutes/hours.

@Chirpybob
Copy link

Hiya, sorry to reopen an old thread, but i could really use some help.
As originally questioned, i need to rotate a shader.

I have a cocktail table (with 2 controls either side) and have placed a pi 3 inside running retropie/attract mode.
I have set up the controls so that i can switch between two shaders, a standard shader for 1 player mode, and the 'cocktail cabinet' shader for 2 player mode, to be switched in game as needed.

The reason i cant use the rotate function in retroarch is because it rotates both shaders, therefore always putting one of them off center.

I have tried the 'cocktail-cab-portrait' shader. But although the picture is rotated correctly, the image is still distorted, and no ammount of adjusting or playing with the preview options will make it display correctly (with 'cocktail cabinet' shader, plus retroarch rotation however, i can)

I posted a question in the retropie forum and was directed here.

So.....
Is it possible to put a rotate command in either shader?

Thanks for your time.
Chirpy.

@hizzlekizzle
Copy link
Collaborator

Depending on what your other shader is, you can try replacing the texcoord assignment line (that is, vTexCoord = TexCoord;) in the vertex shader with:
vTexCoord = ((TexCoord - 0.5) * mat2x2(0.0, 1.0, -1.0, 0.0)) + 0.5;
Swap the 1.0 and -1.0 there in the mat2x2 to rotate it CCW instead of CW.

@Chirpybob
Copy link

Hi there, thanks for replying.

I've gone through all the glsl files in retroarch and cant find any with the word 'vTexCoord' in to edit.
Do i need to open the file in another program?
Am i making a noob mistake? (probably).

@hizzlekizzle
Copy link
Collaborator

Most of the ones I've hand-converted have it in there but the auto-converted ones don't. Which shader are you using that needs to rotate? Some are more difficult than others.

@Chirpybob
Copy link

The cocktail-cabinet.glsl if possible. But barring that one absolutely any shader that will show a clear picture, doesn't need to be authentic as it will be applied to multiple systems/emulators.
If any other shader can be rotated 90 degrees, i could then tell retroarch to rotate the screen again, thus straitening the cocktail cabinet shader.

@Chirpybob
Copy link

Chirpybob commented Apr 20, 2017

Apologies, i was looking in the completly wrong area at shaders,
I can see where the 'vTexCoord' word is used often, however i have yet to find and shader with the line 'vTexCoord = TexCoord'.

Taking one form the top of the list for example. '3dfx_pass_0.glsl':

under '// compatibility #defines' on line 148 i see '#define vTexCoord TEX0.xy'
I tried to change the 'TEXO.xy' to the code you gave me. but with no luck. the shader worked, but with no rotation.

I also tried inserting the code into various areas in '// Paste vertex contents here:', but no joy there either.

@hizzlekizzle
Copy link
Collaborator

Ah, wait, nevermind. I was testing that line with the slang shaders, which have some key differences from the regular GLSL shaders that specifically complicate this task.

How about having a separate config that just disables rotation and sets video_shader_enable to "true" and you can use configuration > load configuration whenever you want to play it in cocktail orientation? The rest of the time, the screen would be rotated with no shader.

@Chirpybob
Copy link

I've tried that, using the configuration editor included with retropie. I disabled all rotation, but the shader doesn't care. (As a matter of fact, nothing cares, things rotate exactly the same. This setting seems useless....)
I can also see in the shader parameters, that when i change the width, the height is changed and vice versa.
This is consistant with a rotated screen.
Is there any way to identify what line of code tells the shader to rotate?
Or to make a fresh shader that only rotates?

If this can be done, it would mean (in my eyes) the perfect cocktail machine. with no need to go into any menus thus making it as user friendly as you can get. :-)

@hizzlekizzle
Copy link
Collaborator

I guess I'm not following what the actual problem is. When I go to settings > video and change the rotation to 90 or 270 degrees, it rotates the screen and the shader.

The cocktail cabinet shader rotates and doubles the image so that two people on either end of a widescreen monitor have their own copy of the image.

What's missing?

@Chirpybob
Copy link

Apologies if i'm not being clear.

Rotating the screen with retroarch settings does allow you to use the 'cocktail-cabinet.glsl' on portrait mode (after tweaking the parameters slightly).
However if you want to switch straight to another shader (using hot keys assigned in retroarch), that shader will be at an incorrect angle. And you would then have to go back into retroarch settings in order to rotate it back.

If either shader could be rotated individually, they could then be made to sync up, taking away the need to go into retroarch settings each time.

So when i have friends round to use my cocktail table. (who like games but not computers) I can tell them to press 1 button for 1 player, and another button for 2 player. As opposed to explaining how to enter a menu and rotate the screen. :-)

@Newbieuseros
Copy link

Newbieuseros commented Jun 12, 2022

Hi hizzlekizzle
OK. I am totally new in all of this.
End trying to make some cocktail cabinet with mirror screen games.
And have a similar problem:

I tried two variants:

  1. https://raw.githubusercontent.com/libretro/glsl-shaders/master/misc/cocktail-cab-portrait.glsl
  2. https://raw.githubusercontent.com/libretro/glsl-shaders/master/misc/cocktail-cabinet.glsl

The first version doesn't really rotate the screen image but I do it myself with "sudo nano /boot/config.txt" etc.
Works fine except the image is too narrow (up-down) for horisontal games, for example for "Cadillacs and dinosaurus"
and I can t do nothing to expand it.

The second does rotate shader and does have a expanded picture but it is opposite to screen orientation.

My question is:
Have you made a version in which the shader does not rotate, ie rotates according to the orientation of the screen and at the same time, allows the image of the game to be freely expanded for horizontal games.
Ah, yes, and also can use billinear filtering, because the first version can not (does not allow it)
Thanks in advance !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants