Mirroring game images

  • Agnosticpriest
  • Topic Author
More
6 years 1 month ago #1 by Agnosticpriest Mirroring game images was created by Agnosticpriest
About a year ago someone posted a thread trying to mirror the image of his games and marty mcfly posted this shader.

What I'm hoping to get out of this is I want to invert the game i'm playings horizontal controls, and mirror the image itself horizontally so that I could have an alternative/somewhat different experience with games I already know and love. But the instructions are a little vague in the original thread and I'm hoping to get a more in depth explanation.

DeMondo wrote:

Marty McFly wrote: Create new text file, put this in and save as *.fx file. By default it flips both axes, comment a line with // to disable one axis flip. Sorry, wrote this on my phone, don't remember UI variable syntax ad hoc.
If the depth buffer is flipped as well, put this at the very end (so all shaders have matching color and depth buffer), if the depth buffer is correct but color buffer flipped, put this at the very start of the technique list.



#include "ReShade.fxh"

float4 FlipPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target
{
texcoord.x = 1-texcoord.x;//horizontal flip
texcoord.y = 1-texcoord.y;//vertical flip
float4 color = tex2D(ReShade::BackBuffer, texcoord);
return color;
}

technique Flip
{
pass
{
VertexShader = PostProcessVS;
PixelShader = FlipPass;
}
}


>>>Thank you for the shader, what to change (or add) in the shadercode to have this mirror effect being applied for half side of screen?


The issue i'm having is not that its bugged or anything, its just it rotates the image 180 degrees, and I'm a little confused as to his instructions in this thread.

I'm not sure what he meant by "comment a line with // to disable one axis flip" ive tried putting them at the bottom, ive tried putting them before texcoord.y and nothing i try really works.

Please Log in or Create an account to join the conversation.

  • brussell
More
6 years 1 month ago - 6 years 1 month ago #2 by brussell Replied by brussell on topic Mirroring game images
It seems rotated because the image is flipped horizontally AND vertically. You have to change the line
texcoord.y = 1-texcoord.y;//vertical flip
to
//texcoord.y = 1-texcoord.y;//vertical flip
Starting a line with // means that everything behind // is ignored by the compiler
Last edit: 6 years 1 month ago by brussell.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.