LYGIA Shader Library

flipY (lygia/v1.1.6/space/flipY)

Flip Y axis

Use:

<vec2|vec3|vec4> flipY(<vec2|vec3|vec4> st)

Check it on Github


#ifndef FNC_FLIPY
#define FNC_FLIPY
vec2 flipY(in vec2 v) { return vec2(v.x, 1. - v.y); }
vec3 flipY(in vec3 v) { return vec3(v.x, 1. - v.y, v.z); }
vec4 flipY(in vec4 v) { return vec4(v.x, 1. - v.y, v.z, v.w); }
#endif

Use:

<float2|float3|float4> flipY(<float2|float3|float4> st)

Check it on Github


#ifndef FNC_FLIPY
#define FNC_FLIPY
float2 flipY(in float2 st) { return float2(st.x, 1. - st.y);}
float3 flipY(in float3 st) { return float3(st.x, 1. - st.y, st.z);}
float4 flipY(in float4 st) { return float4(st.x, 1. - st.y, st.z, st.w);}
#endif

LYGIA is dual-licensed under the Prosperity License and the Patron License for sponsors and contributors.

Sponsors and contributors are automatically added to the Patron License and they can ignore the any non-commercial rule of the Prosperity Licensed software (please take a look to the exception).

It's also possible to get a permanent comercial license hook to a single and specific version of LYGIA.

Get the latest news and releases

Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository