浏览代码

global intensity

ncannasse 7 年之前
父节点
当前提交
db4b43017f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      h3d/shader/pbr/Bloom.hx

+ 2 - 1
h3d/shader/pbr/Bloom.hx

@@ -14,8 +14,9 @@ class Bloom extends ScreenShader {
 		function fragment() {
 			pixelColor = hdr.get(calculatedUV);
 			var lum = pixelColor.rgb.dot(vec3(0.2126, 0.7152, 0.0722));
-			if( lum < threshold ) pixelColor.rgb = vec3(0.) else pixelColor.rgb *= intensity * (lum - threshold) / lum;
+			if( lum < threshold ) pixelColor.rgb = vec3(0.) else pixelColor.rgb *= (lum - threshold) / lum;
 			pixelColor.rgb += albedo * emissive;
+			pixelColor.rgb *= intensity;
 		}
 
 	};