/* The shuddererrrrrrrr
*/
shader_type spatial;

uniform mediump float jitter_magnitude = 0.1;
uniform mediump float time_scale = 0.1;
uniform lowp float time_pixellation = 100.0;

uniform highp sampler3D jitter_noise;

void vertex() {
	float mixer = VERTEX.x + 0.553 * VERTEX.z + 1.618 * VERTEX.y;
	float local_time = floor(TIME * time_scale * time_pixellation) / time_pixellation;
	float sample = texture(jitter_noise, vec3(cos(mixer), sin(mixer), local_time)).r;
	float jitter = jitter_magnitude * (sample - 0.5);
	VERTEX *= 1.0 + jitter;
}