Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dfcf530

Browse files
committed
Fixed fresnel blend missing costo factor for diffuse part, resulting in too much light being reflected.
1 parent 411e57b commit dfcf530

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Graphics/Bling/Reflection/Microfacet.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ mkFresnelBlend rd rs ra dist depth = mkBxDF [Reflection, Glossy] e s p where
7373
else white
7474

7575
-- diffuse
76-
diff = sScale (a * rd * (white - rs)) $ (28 / 23 * pi) *
76+
diff = sScale (a * rd * (white - rs)) $
77+
(costo * 28 / 23 * pi) *
7778
(1 - ((1 - 0.5 * costi) ** 5)) *
7879
(1 - ((1 - 0.5 * costo) ** 5))
7980

0 commit comments

Comments
 (0)