Created
May 6, 2013 14:42
-
-
Save tcsavage/5525586 to your computer and use it in GitHub Desktop.
Diffuse shading with shadows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diffuseM :: Colour -> Material () (BSDF Colour) | |
diffuseM col = proc () -> do | |
out <- diffuse -< col -- Get diffuse shading | |
shad <- traceM <<< getInidentRay -< () -- Test path to light | |
returnA -< maybe holdout (\(_,_,_,e) -> if e then out else holdout) shad -- Set BSDF to black if in shadow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment