]> gitweb.ps.run Git - subsurface_scattering/blobdiff - shaders/fbo_frag.glsl
SSSSS comments
[subsurface_scattering] / shaders / fbo_frag.glsl
index 7463fc858a87636ff57917867bbc5494ca366956..f92483e3b55227d27f277a63edf9770e69e8d605 100644 (file)
@@ -16,19 +16,18 @@ void main()
     if (renderState == 0) {\r
         FragColor = texture(shadowmapTexture, TexCoords);\r
     }\r
-    // stencil buffer\r
     else if (renderState == 1) {\r
         FragColor = texture(irradianceTexture, TexCoords);\r
     }\r
     else if (renderState == 2) {\r
-        FragColor = texture(shadowmapTexture, TexCoords) * texture(irradianceTexture, TexCoords);\r
-    }\r
-    else if (renderState == 3) {\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
+            //            * texture(shadowmapTexture, sampleCoords);\r
+            vec4 sample = texture(irradianceTexture, sampleCoords);\r
             vec4 weight = vec4(sampleWeights[i], 1);\r
             result += sample * weight;\r
         }\r