]> gitweb.ps.run Git - subsurface_scattering/blobdiff - shaders/ts_frag_irradiance.glsl
comments TS SSS
[subsurface_scattering] / shaders / ts_frag_irradiance.glsl
index b9e70ae50f5e5d0c2aaa5c2debce1915e3cd48d4..37d28f12a9ca109adcdce3e56be169842f5b962d 100644 (file)
@@ -10,52 +10,11 @@ uniform vec3 lightColor;
 uniform vec3 objectColor;\r
 uniform vec3 viewPos;\r
 \r
 uniform vec3 objectColor;\r
 uniform vec3 viewPos;\r
 \r
-vec4 blur(sampler2D tex, vec2 uv, vec2 res) {\r
-  float Pi = 6.28318530718; // Pi*2\r
-    \r
-  // GAUSSIAN BLUR SETTINGS {{{\r
-  float Directions = 16.0; // BLUR DIRECTIONS (Default 16.0 - More is better but slower)\r
-  float Quality = 4.0; // BLUR QUALITY (Default 4.0 - More is better but slower)\r
-  float Size = 8.0; // BLUR SIZE (Radius)\r
-  // GAUSSIAN BLUR SETTINGS }}}\r
-  \r
-  vec2 Radius = Size/res;\r
-  \r
-  // Pixel colour\r
-  vec4 Color = texture(tex, uv);\r
-  \r
-  // Blur calculations\r
-  for( float d=0.0; d<Pi; d+=Pi/Directions) {\r
-    for(float i=1.0/Quality; i<=1.0; i+=1.0/Quality) {\r
-      Color += texture( tex, uv+vec2(cos(d),sin(d))*Radius*i);         \r
-    }\r
-  }\r
-  \r
-  // Output to screen\r
-  Color /= Quality * Directions - 15.0;\r
-  return Color;\r
-}\r
-\r
 void main()\r
 {\r
 void main()\r
 {\r
-  vec3 norm = normalize(Normal);\r
-  vec3 lightDir = normalize(lightPos - FragPos);\r
-\r
-  float diff = max(dot(norm, lightDir), 0.0);\r
-  vec3 diffuse = diff * lightColor;\r
-\r
-  float ambientStrength = 0.1;\r
-  vec3 ambient = ambientStrength * lightColor;\r
-\r
-  float specularStrength = 0.5;\r
-  vec3 viewDir = normalize(viewPos - FragPos);\r
-  vec3 reflectDir = reflect(-lightDir, norm);\r
-  float spec = pow(max(dot(viewDir, reflectDir), 0.0), 32);\r
-  vec3 specular = specularStrength * spec * lightColor;\r
-\r
-  vec3 result = (ambient + diffuse) * objectColor;\r
-\r
-  result = vec3(length(FragPos - lightPos));\r
+  // color the XY-plane according to the distance\r
+  // of the fragment in world space\r
+  vec3 result = vec3(length(FragPos - lightPos));\r
     \r
   FragColor = vec4(result, 1.0f);\r
 }\r
     \r
   FragColor = vec4(result, 1.0f);\r
 }\r