Welcome, Guest.
Username: Password: Remember me

TOPIC: Mirroring game images

Mirroring game images 5 months 2 weeks ago #1

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.
The administrator has disabled public write access.

Mirroring game images 5 months 2 weeks ago #2

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: 5 months 2 weeks ago by brussell.
The administrator has disabled public write access.