Welcome, Guest.
Username: Password: Remember me

TOPIC: Flip and Mirror Entire Image

Flip and Mirror Entire Image 1 year 2 months ago #1

I'm looking to resolve an issue that I am having and hopefully Reshade is the solution.

The issue: I am trying to stream cemu.exe WiiU emulator through Steam Link, but for some reason due to OpenGL drivers and the way the software is developed, the image is flipped vertically and mirrored.

The Cemu devs stated this is the reason: "This is not a bug in CEMU. We use a very recently added OpenGL feature called 'ARB_clip_control' which will result in upside-down images if this feature is not taken into account by third-party tools. Report the bug to the developer of the overlay."

I would like to write a shader that counteracts this reversal. Is this possible or is there perhaps and easier way?
The administrator has disabled public write access.

Flip and Mirror Entire Image 1 year 2 months ago #2

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
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;
}
}
Last Edit: 1 year 2 months ago by Marty McFly.
The administrator has disabled public write access.
The following user(s) said Thank You: DeMondo

Flip and Mirror Entire Image 10 months 3 weeks ago #3

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