LYGIA Shader Library

mirrorTile (lygia/space/mirrorTile)

mirror a tiles pattern

Dependencies:

Use:

<vec4> mirrorTile(<vec4> tile)
<vec4> mirrorTile(<vec2> st [, <float|vec2> scale])
<vec4> mirrorXTile(<vec4> tile)
<vec4> mirrorXTile(<vec2> st [, <float|vec2> scale])
<vec4> mirrorYTile(<vec4> tile)
<vec4> mirrorYTile(<vec2> st [, <float|vec2> scale])

Check it on Github



#ifndef FNC_MIRRORTILE
#define FNC_MIRRORTILE

vec4 mirrorTile(vec4 t) { return vec4( mirror(t.xy + t.zw), t.z, t.w); }
vec4 mirrorTile(vec2 v) { return mirrorTile(sqTile(v)); }
vec4 mirrorTile(vec2 v, float s) { return mirrorTile(v * s); }
vec4 mirrorTile(vec2 v, vec2 s) { return mirrorTile(v * s); }

vec4 mirrorXTile(vec4 t) { return vec4( mirror(t.x + t.z), t.y, t.z, t.w); }
vec4 mirrorXTile(vec2 v) { return mirrorXTile(sqTile(v)); }
vec4 mirrorXTile(vec2 v, float s) { return mirrorXTile(v * s); }
vec4 mirrorXTile(vec2 v, vec2 s) { return mirrorXTile(v * s); }

vec4 mirrorYTile(vec4 t) { return vec4( t.x, mirror(t.y + t.w), t.z, t.w); }
vec4 mirrorYTile(vec2 v) { return mirrorYTile(sqTile(v)); }
vec4 mirrorYTile(vec2 v, float s) { return mirrorYTile(v * s); }
vec4 mirrorYTile(vec2 v, vec2 s) { return mirrorYTile(v * s); }

#endif

Dependencies:

Use:

<float4> mirrorTile(<float4> tile)
<float4> mirrorTile(<float2> st [, <float|float2> scale])
<float4> mirrorXTile(<float4> tile)
<float4> mirrorXTile(<float2> st [, <float|float2> scale])
<float4> mirrorYTile(<float4> tile)
<float4> mirrorYTile(<float2> st [, <float|float2> scale])

Check it on Github



#ifndef FNC_MIRRORTILE
#define FNC_MIRRORTILE
float4 mirrorTile(float4 tile) { return float4( mirror(tile.xy + tile.zw), tile.z, tile.w); }
float4 mirrorTile(float2 st) { return mirrorTile(sqTile(st)); }
float4 mirrorTile(float2 st, float scale) { return mirrorTile(st * scale); }
float4 mirrorTile(float2 st, float2 scale) { return mirrorTile(st * scale); }

float4 mirrorXTile(float4 tile) { return float4( mirror(tile.x + tile.z), tile.y, tile.z, tile.w); }
float4 mirrorXTile(float2 st) { return mirrorXTile(sqTile(st)); }
float4 mirrorXTile(float2 st, float scale) { return mirrorXTile(st * scale); }
float4 mirrorXTile(float2 st, float2 scale) { return mirrorXTile(st * scale); }

float4 mirrorYTile(float4 tile) { return float4( tile.x, mirror(tile.y + tile.w), tile.z, tile.w); }
float4 mirrorYTile(float2 st) { return mirrorYTile(sqTile(st)); }
float4 mirrorYTile(float2 st, float scale) { return mirrorYTile(st * scale); }
float4 mirrorYTile(float2 st, float2 scale) { return mirrorYTile(st * scale); }

#endif

Dependencies:

Use:

<float4> mirrorTile(<float4> tile)
<float4> mirrorTile(<float2> st [, <float|float2> scale])
<float4> mirrorXTile(<float4> tile)
<float4> mirrorXTile(<float2> st [, <float|float2> scale])
<float4> mirrorYTile(<float4> tile)
<float4> mirrorYTile(<float2> st [, <float|float2> scale])

Check it on Github



#ifndef FNC_MIRRORTILE
#define FNC_MIRRORTILE

float4 mirrorTile(float4 t) { return float4( mirror(t.xy + t.zw), t.z, t.w); }
float4 mirrorTile(float2 v) { return mirrorTile(sqTile(v)); }
float4 mirrorTile(float2 v, float s) { return mirrorTile(v * s); }
float4 mirrorTile(float2 v, float2 s) { return mirrorTile(v * s); }

float4 mirrorXTile(float4 t) { return float4( mirror(t.x + t.z), t.y, t.z, t.w); }
float4 mirrorXTile(float2 v) { return mirrorXTile(sqTile(v)); }
float4 mirrorXTile(float2 v, float s) { return mirrorXTile(v * s); }
float4 mirrorXTile(float2 v, float2 s) { return mirrorXTile(v * s); }

float4 mirrorYTile(float4 t) { return float4( t.x, mirror(t.y + t.w), t.z, t.w); }
float4 mirrorYTile(float2 v) { return mirrorYTile(sqTile(v)); }
float4 mirrorYTile(float2 v, float s) { return mirrorYTile(v * s); }
float4 mirrorYTile(float2 v, float2 s) { return mirrorYTile(v * s); }

#endif

Examples

Licenses

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