mirror of
https://github.com/recp/cglm.git
synced 2025-10-03 16:51:35 +00:00
glm__noiseDetail_taylorInvSqrt
This commit is contained in:
@@ -57,11 +57,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* glm__noiseDetail_taylorInvSqrt(vec4 x, vec4 dest) */
|
/* glm__noiseDetail_taylorInvSqrt(vec4 x, vec4 dest) */
|
||||||
#define glm__noiseDetail_taylorInvSqrt(x, dest) { \
|
#define glm__noiseDetail_taylorInvSqrt(x, dest) { \
|
||||||
dest[0] = 1.79284291400159f - 0.85373472095314f * x[0]; \
|
/* dest = 1.79284291400159f - 0.85373472095314f * x */ \
|
||||||
dest[1] = 1.79284291400159f - 0.85373472095314f * x[1]; \
|
vec4 temp; \
|
||||||
dest[2] = 1.79284291400159f - 0.85373472095314f * x[2]; \
|
glm_vec4_scale(x, 0.85373472095314f, temp); /* temp = 0.853...f * x */ \
|
||||||
dest[3] = 1.79284291400159f - 0.85373472095314f * x[3]; \
|
glm_vec4_fill(dest, 1.79284291400159f); /* dest = 1.792...f */ \
|
||||||
|
glm_vec4_sub(dest, temp, dest); /* dest = 1.79284291400159f - temp */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* norm = taylorInvSqrt(vec4(
|
/* norm = taylorInvSqrt(vec4(
|
||||||
|
Reference in New Issue
Block a user