14 lines
No EOL
587 B
GLSL
14 lines
No EOL
587 B
GLSL
/*
|
|
contributors: Patricio Gonzalez Vivo
|
|
description: make some square tiles. XY provide coords inside of the tile. ZW provides tile coords
|
|
use: <vec4> hexTile(<vec2> st [, <float> scale])
|
|
license:
|
|
- Copyright (c) 2021 Patricio Gonzalez Vivo under Prosperity License - https://prosperitylicense.com/versions/3.0.0
|
|
- Copyright (c) 2021 Patricio Gonzalez Vivo under Patron License - https://lygia.xyz/license
|
|
*/
|
|
|
|
#ifndef FNC_SQTILE
|
|
#define FNC_SQTILE
|
|
vec4 sqTile(vec2 st) { return vec4(fract(st), floor(st)); }
|
|
vec4 sqTile(vec2 st, float scale) { return sqTile(st * scale); }
|
|
#endif |