13 lines
No EOL
558 B
GLSL
13 lines
No EOL
558 B
GLSL
/*
|
|
contributors: [Stefan Gustavson, Ian McEwan]
|
|
description: Fast, accurate inverse square root.
|
|
use: <float|vec2|vec3|vec4> taylorInvSqrt(<float|vec2|vec3|vec4> x)
|
|
*/
|
|
|
|
#ifndef FNC_TAYLORINVSQRT
|
|
#define FNC_TAYLORINVSQRT
|
|
float taylorInvSqrt(in float r) { return 1.79284291400159 - 0.85373472095314 * r; }
|
|
vec2 taylorInvSqrt(in vec2 r) { return 1.79284291400159 - 0.85373472095314 * r; }
|
|
vec3 taylorInvSqrt(in vec3 r) { return 1.79284291400159 - 0.85373472095314 * r; }
|
|
vec4 taylorInvSqrt(in vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }
|
|
#endif |