Search Unity

Invert Y of Screen Space?

Discussion in 'Shaders' started by Hybridizer, Nov 30, 2017.

  1. Hybridizer

    Hybridizer

    Joined:
    Feb 3, 2015
    Posts:
    18
    A pretty straightforward question: How can I invert the y-dimension of a Screen Space texture?
    Specifically, I'm using a Screen Space-oriented Render Texture for reflections, and need to flip the Y-dimension of the final result. Attempting to adjust the x,y, or z dimensions of the result or any aspect that leads up to it just results in inverted colors, and as of now I've only gotten search results dealing with rendering issues. Is there a simple solution to achieve my desired effect or will it be long, complex process? I have a moderate understanding of surface shaders, and novice understanding of vertex and fragment shaders. Any help is appreciated.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    By flipping the uv?
    tex2D(_Tex, float2(screenUV.x, 1 - screenUV.y))