23 lines
623 B
Text
23 lines
623 B
Text
/*
|
|
contributors: Patricio Gonzalez Vivo
|
|
description: Flips the float passed in, 0 becomes 1 and 1 becomes 0
|
|
use: flip(<float> v, <float> pct)
|
|
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_FLIP
|
|
#define FNC_FLIP
|
|
float flip(float v, float pct) {
|
|
return mix(v, 1.0 - v, pct);
|
|
}
|
|
|
|
float3 flip(float3 v, float pct) {
|
|
return mix(v, 1.0 - v, pct);
|
|
}
|
|
|
|
float4 flip(float4 v, float pct) {
|
|
return mix(v, 1.0 - v, pct);
|
|
}
|
|
#endif
|