lygia
/math
/pow5
)power of 5
Use:
<float|vec2|vec3|vec4> pow5(<float|vec2|vec3|vec4> v)
#ifndef FNC_POW5
#define FNC_POW5
float pow5(const in float v) {
float v2 = v * v;
return v2 * v2 * v;
}
vec2 pow5(const in vec2 v) {
vec2 v2 = v * v;
return v2 * v2 * v;
}
vec3 pow5(const in vec3 v) {
vec3 v2 = v * v;
return v2 * v2 * v;
}
vec4 pow5(const in vec4 v) {
vec4 v2 = v * v;
return v2 * v2 * v;
}
#endif
Use:
<float|float2|float3|float4> pow5(<float|float2|float3|float4> x)
#ifndef FNC_POW5
#define FNC_POW5
float pow5(in float x) {
float x2 = x * x;
return x2 * x2 * x;
}
float2 pow5(in float2 x) {
float2 x2 = x * x;
return x2 * x2 * x;
}
float3 pow5(in float3 x) {
float3 x2 = x * x;
return x2 * x2 * x;
}
float4 pow5(in float4 x) {
float4 x2 = x * x;
return x2 * x2 * x;
}
#endif
Use:
<float|float2|float3|float4> pow5(<float|float2|float3|float4> v)
#ifndef FNC_POW5
#define FNC_POW5
float pow5(const float v) {
float v2 = v * v;
return v2 * v2 * v;
}
float2 pow5(const float2 v) {
float2 v2 = v * v;
return v2 * v2 * v;
}
float3 pow5(const float3 v) {
float3 v2 = v * v;
return v2 * v2 * v;
}
float4 pow5(const float4 v) {
float4 v2 = v * v;
return v2 * v2 * v;
}
#endif
Dependencies:
lygia
/math
/operations
.glsl
Use:
<float|float2|float3|float4> pow5(<float|float2|float3|float4> x)
#ifndef FNC_POW5
#define FNC_POW5
inline __host__ __device__ float pow5(float x) {
float x2 = x * x;
return x2 * x2 * x;
}
inline __host__ __device__ float2 pow5(const float2& x) {
float2 x2 = x * x;
return x2 * x2 * x;
}
inline __host__ __device__ float3 pow5(const float3& x) {
float3 x2 = x * x;
return x2 * x2 * x;
}
inline __host__ __device__ float4 pow5(const float4& x) {
float4 x2 = x * x;
return x2 * x2 * x;
}
#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.
Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository