 
 		vec2 poissonDisk[NUM_SAMPLES];
 
-		void initPoissonSamples( const in vec2 randomSeed )
-		{
+		void initPoissonSamples( const in vec2 randomSeed )	{
 			poissonDisk[0] = vec2(-0.94201624, -0.39906216 );
 			poissonDisk[1] = vec2( 0.94558609, -0.76890725 );
 			poissonDisk[2] = vec2( -0.094184101, -0.92938870 );

			poissonDisk[14] = vec2( 0.19984126, 0.78641367 );
			poissonDisk[15] = vec2( 0.14383161, -0.14100790 );

			/*float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );
			float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );

			// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/
			float angle = rand( randomSeed ) * PI2;
			float radius = INV_NUM_SAMPLES;
			float radiusStep = radius;

			for( int i = 0; i < NUM_SAMPLES; i ++ ) {
				poissonDisk[i] = vec2( cos( angle ), sin( angle ) ) * pow( radius, 0.75 );
				radius += radiusStep;
				angle += ANGLE_STEP;
			}*/
		}

		float penumbraSize( const in float zReceiverLightSpace, const in float zBlockerLightSpace ) { // Parallel plane estimation
			return (zReceiverLightSpace - zBlockerLightSpace) / zBlockerLightSpace;
		}

		float findBlocker( sampler2D shadowMap, const in vec2 uv, const in float zReceiverClipSpace, const in float zReceiverLightSpace, const in vec2 randomSeed ) {
			// This uses similar triangles to compute what
			// area of the shadow map we should search
			float searchRadius = LIGHT_SIZE_UV * ( zReceiverLightSpace - LIGHT_NEAR_PLANE ) / zReceiverLightSpace;
			float blockerDepthSum = 0.0;
			int numBlockers = 0;
			float angle = rand( randomSeed ) * PI2;
			float s = sin(angle);
			float c = cos(angle);
			for( int i = 0; i < BLOCKER_SEARCH_NUM_SAMPLES; i++ ) {
				#ifdef ROTATE_POISSON_SAMPLES
					vec2 poissonSample = vec2(poissonDisk[i].y * c + poissonDisk[i].x * s, poissonDisk[i].y * -s + poissonDisk[i].x * c);
			  #else
					vec2 poissonSample = poissonDisk[i];
				#endif
				float shadowMapDepth = unpackRGBAToDepth(texture2D(shadowMap, uv + poissonSample * searchRadius));
				if ( shadowMapDepth < zReceiverClipSpace ) {
					blockerDepthSum += shadowMapDepth;
					numBlockers ++;
				}
			}

			if( numBlockers == 0 ) return -1.0;


			// STEP 3: filtering
			//return avgBlockerDepth;
			return PCF_Filter( shadowMap, uv, zReceiverClipSpace, filterRadius );
		}

	#endif
