+{\r
+ // sample calculated irradiance\r
+ // using Gaussian kernel to approximate light spread\r
+ vec4 result = vec4(0, 0, 0, 1);\r
+ for (int i = 0; i < 13; i++) {\r
+ vec2 sampleCoords = TexCoords + samplePositions[i] * vec2(1.0/screenWidth, 1.0/screenHeight);\r
+ //vec4 sample = texture(irradianceTexture, sampleCoords)\r
+ // * texture(shadowmapTexture, sampleCoords);\r
+ vec4 sample = texture(irradianceTexture, sampleCoords);\r
+ vec4 weight = vec4(sampleWeights[i], 1);\r
+ result += sample * weight;\r
+ }\r
+ FragColor = result;\r