 			poissonDisk[13] = vec2( -0.81409955, 0.91437590 );
 			poissonDisk[14] = vec2( 0.19984126, 0.78641367 );
 			poissonDisk[15] = vec2( 0.14383161, -0.14100790 );
-
-			#if PCSS_ROTATE_POISSON_SAMPLES == 1
-				float angle = rand( randomSeed ) * PI2;
-				float c = cos(angle), s = sin(angle);
-				mat2 rotation = mat2( c, s, -s, c );
-				for( int i = 0; i < PCSS_NUM_POISSON_SAMPLES; i++ ) {
-					poissonDisk[i] *= rotation;
-				}
-			#endif
+		}
+
+		mat2 createRotationMatrix( const in vec2 randomSeed ) {
+			float angle = rand( randomSeed ) * PI2;
+			float c = cos( angle ), s = sin( angle );
+			return mat2( c, s, -s, c );
 		}
 
 		float penumbraSize( const in float zReceiverLightSpace, const in float zBlockerLightSpace ) { // Parallel plane estimation

			float blockerDepthSum = 0.0;
			int numBlockers = 0;

			for( int i = 0; i < PCSS_NUM_POISSON_SAMPLES; i++ ) {

				float shadowMapDepth = unpackRGBAToDepth( texture2D( shadowMap, uv + poissonDisk[i] * searchRadius ) );

				if ( shadowMapDepth < zReceiverClipSpace ) {
					blockerDepthSum += shadowMapDepth;
					numBlockers ++;
				}

			}

			return blockerDepthSum / float( numBlockers );
		}

		float percentCloserFilter( sampler2D shadowMap, const in vec2 uv, const in float zReceiverClipSpace, const in float filterRadius ) {
			float sum = 0.0;

			for( int j = 0; j < PCSS_QUALITY_LEVEL; j ++ ) {

				mat2 poissonRotation = createRotationMatrix( uv.yx + vec2( 0.12, 0.30 ) * float( j ) );

				for( int i = 0; i < PCSS_NUM_POISSON_SAMPLES; i ++ ) {

					vec2 uvOffset = ( poissonDisk[i] * poissonRotation ) * filterRadius;

					float depth = unpackRGBAToDepth( texture2D( shadowMap, uv + uvOffset ) );
					if( zReceiverClipSpace <= depth ) sum += 1.0;

					depth = unpackRGBAToDepth( texture2D( shadowMap, uv - uvOffset ) );
					if( zReceiverClipSpace <= depth ) sum += 1.0;

				}

			}

			return sum / ( 2.0 * float( PCSS_NUM_POISSON_SAMPLES * PCSS_QUALITY_LEVEL ) );
		}

		float percentCloserSoftShadow( sampler2D shadowMap, const in float shadowRadius, const in vec2 shadowCameraNearFar, const in vec4 coords ) {
