Browse Source

updated code doco

Huw Bowles 13 years ago
parent
commit
fa28f105e9
2 changed files with 5 additions and 2 deletions
  1. 3 1
      examples/js/ShaderGodRays.js
  2. 2 1
      examples/webgl_postprocessing_godrays.html

+ 3 - 1
examples/js/ShaderGodRays.js

@@ -81,7 +81,9 @@
     		        
     		        
 		            // The check for uv.y<1 would not be necessary with "border" UV wrap
 		            // The check for uv.y<1 would not be necessary with "border" UV wrap
 		            // mode, with a black border colour. I don't think this is currently
 		            // mode, with a black border colour. I don't think this is currently
-		            // exposed by three.js.
+		            // exposed by three.js. As a result there might be artifacts when the
+		            // sun is to the left, right or bottom of screen as these cases are
+		            // not specifically handled.
 		            "col += (i <= iters && uv.y<1. ? texture2D( tInput, uv ).r : .0) ;",
 		            "col += (i <= iters && uv.y<1. ? texture2D( tInput, uv ).r : .0) ;",
 		            "uv += stepv;",
 		            "uv += stepv;",
 		        "}",
 		        "}",

+ 2 - 1
examples/webgl_postprocessing_godrays.html

@@ -217,7 +217,7 @@
 				postprocessing.rtTextureGodRays1 = new THREE.WebGLRenderTarget( w, h, pars );
 				postprocessing.rtTextureGodRays1 = new THREE.WebGLRenderTarget( w, h, pars );
 				postprocessing.rtTextureGodRays2 = new THREE.WebGLRenderTarget( w, h, pars );
 				postprocessing.rtTextureGodRays2 = new THREE.WebGLRenderTarget( w, h, pars );
 				
 				
-                // GOD RAY POST PROC
+                // god-ray shaders
 
 
 				var godray_gen_shader = THREE.ShaderGodRays[ "godrays_generate" ];
 				var godray_gen_shader = THREE.ShaderGodRays[ "godrays_generate" ];
 				postprocessing.godray_gen_uniforms = THREE.UniformsUtils.clone( godray_gen_shader.uniforms );
 				postprocessing.godray_gen_uniforms = THREE.UniformsUtils.clone( godray_gen_shader.uniforms );
@@ -348,6 +348,7 @@
 			        postprocessing.godray_gen_uniforms[ "tInput" ].texture = postprocessing.rtTextureGodRays1;
 			        postprocessing.godray_gen_uniforms[ "tInput" ].texture = postprocessing.rtTextureGodRays1;
 			        renderer.render( postprocessing.scene, postprocessing.camera , postprocessing.rtTextureGodRays2  );
 			        renderer.render( postprocessing.scene, postprocessing.camera , postprocessing.rtTextureGodRays2  );
 			        
 			        
+			        // final pass - composite god-rays onto colors
 			        postprocessing.godray_combine_uniforms["tColors"].texture = postprocessing.rtTextureColors;
 			        postprocessing.godray_combine_uniforms["tColors"].texture = postprocessing.rtTextureColors;
 			        postprocessing.godray_combine_uniforms["tGodRays"].texture = postprocessing.rtTextureGodRays2;
 			        postprocessing.godray_combine_uniforms["tGodRays"].texture = postprocessing.rtTextureGodRays2;
 					postprocessing.scene.overrideMaterial = postprocessing.materialGodraysCombine;
 					postprocessing.scene.overrideMaterial = postprocessing.materialGodraysCombine;