fuckingtech/public/assets/glsl/lygia/space/center.msl
Elias Rhouzlane bf76c6b086 fix: code
2025-04-06 17:23:52 +02:00

20 lines
No EOL
745 B
Text

/*
contributors: Patricio Gonzalez Vivo
description: "It center the coordinates from 0 to 1 to -1 to 1\nSo the center goes\
\ from 0.5 to 0.0. \n"
use: <float|float2|float3> center(<float|float2|float3> st)
examples:
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/draw_shapes.frag
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_CENTER
#define FNC_CENTER
float center(float x) { return x * 2.0 - 1.0; }
float2 center(float2 v) { return v * 2.0 - 1.0; }
float3 center(float3 v) { return v * 2.0 - 1.0; }
#endif