110(gx0.w, gy0.w, gz0.w);
		detail::tvec3<T, P> g001(gx1.x, gy1.x, gz1.x);
		detail::tvec3<T, P> g101(gx1.y, gy1.y, gz1.y);
		detail::tvec3<T, P> g011(gx1.z, gy1.z, gz1.z);
		detail::tvec3<T, P> g111(gx1.w, gy1.w, gz1.w);

		detail::tvec4<T, P> norm0 = taylorInvSqrt(detail::tvec4<T, P>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));
		g000 *= norm0.x;
		g010 *= norm0.y;
		g100 *= norm0.z;
		g110 *= norm0.w;
		detail::tvec4<T, P> norm1 = taylorInvSqrt(detail::tvec4<T, P>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));
		g001 *= norm1.x;
		g011 *= norm1.y;
		g101 *= norm1.z;
		g111 *= norm1.w;

		T n000 = dot(g000, Pf0);
		T n100 = dot(g100, detail::tvec3<T, P>(Pf1.x, Pf0.y, Pf0.z));
		T n010 = dot(g010, detail::tvec3<T, P>(Pf0.x, Pf1.y, Pf0.z));
		T n110 = dot(g110, detail::tvec3<T, P>(Pf1.x, Pf1.y, Pf0.z));
		T n001 = dot(g001, detail::tvec3<T, P>(Pf0.x, Pf0.y, Pf1.z));
		T n101 = dot(g101, detail::tvec3<T, P>(Pf1.x, Pf0.y, Pf1.z));
		T n011 = dot(g011, detail::tvec3<T, P>(Pf0.x, Pf1.y, Pf1.z));
		T n111 = dot(g111, Pf1);

		detail::tvec3<T, P> fade_xyz = fade(Pf0);
		detail::tvec4<T, P> n_z = mix(detail::tvec4<T, P>(n000, n100, n010, n110), detail::tvec4<T, P>(n001, n101, n011, n111), fade_xyz.z);
		detail::tvec2<T, P> n_yz = mix(
			detail::tvec2<T, P>(n_z.x, n_z.y), 
			detail::tvec2<T, P>(n_z.z, n_z.w), fade_xyz.y);
		T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); 
		return T(2.2) * n_xyz;
	}
	*/
	// Classic Perlin noise
	template <typename T, precision P>
	GLM_FUNC_QUALIFIER T perlin(detail::tvec4<T, P> const & Position)
	{
		detail::tvec4<T, P> Pi0 = floor(Position);	// Integer part for indexing
		detail::tvec4<T, P> Pi1 = Pi0 + T(1);		// Integer part + 1
		Pi0 = mod(Pi0, detail::tvec4<T, P>(289));
		Pi1 = mod(Pi1, detail::tvec4<T, P>(289));
		detail::tvec4<T, P> Pf0 = fract(Position);	// Fractional part for interpolation
		detail::tvec4<T, P> Pf1 = Pf0 - T(1);		// Fractional part - 1.0
		detail::tvec4<T, P> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x);
		detail::tvec4<T, P> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y);
		detail::tvec4<T, P> iz0(Pi0.z);
		detail::tvec4<T, P> iz1(Pi1.z);
		detail::tvec4<T, P> iw0(Pi0.w);
		detail::tvec4<T, P> iw1(Pi1.w);

		detail::tvec4<T, P> ixy = detail::permute(detail::permute(ix) + iy);
		detail::tvec4<T, P> ixy0 = detail::permute(ixy + iz0);
		detail::tvec4<T, P> ixy1 = detail::permute(ixy + iz1);
		detail::tvec4<T, P> ixy00 = detail::permute(ixy0 + iw0);
		detail::tvec4<T, P> ixy01 = detail::permute(ixy0 + iw1);
		detail::tvec4<T, P> ixy10 = detail::permute(ixy1 + iw0);
		detail::tvec4<T, P> ixy11 = detail::permute(ixy1 + iw1);

		detail::tvec4<T, P> gx00 = ixy00 / T(7);
		detail::tvec4<T, P> gy00 = floor(gx00) / T(7);
		detail::tvec4<T, P> gz00 = floor(gy00) / T(6);
		gx00 = fract(gx00) - T(0.5);
		gy00 = fract(gy00) - T(0.5);
		gz00 = fract(gz00) - T(0.5);
		detail::tvec4<T, P> gw00 = detail::tvec4<T, P>(0.75) - abs(gx00) - abs(gy00) - abs(gz00);
		detail::tvec4<T, P> sw00 = step(gw00, detail::tvec4<T, P>(0.0));
		gx00 -= sw00 * (step(T(0), gx00) - T(0.5));
