/*
  Temporal dither helper for TAA integration.
  Replaces the repeated #ifdef TAA / #if TAA_MODE pattern.
*/

#ifndef TEMPORAL_DITHER_GLSL
#define TEMPORAL_DITHER_GLSL

float TemporalDither(float dither) {
	#ifdef TAA
	#if TAA_MODE == 0
	dither = fract(dither + frameCounter * TAA_DITHER_MODE0);
	#else
	dither = fract(dither + frameCounter * TAA_DITHER_MODE1);
	#endif
	#endif
	return dither;
}

#endif
