[Haskell-cafe] On syntactic sugar
Jake Mcarthur
jake.mcarthur at gmail.com
Mon May 12 13:05:29 EDT 2008
On May 12, 2008, at 11:41 AM, Lauri Oksanen wrote:
> let x' = x \+ dist \* dir
> nx' = normal geometry
> wi = (-1) \* dir
> in do
> (p, wo) <- brdfCosSampling reflector nx' wi
> let color' = p \** color
> q = min 1 (scalarContribution p)
> in do
> sampler <- biasedCoinSampler q
> (radianceSampler surfaces x' wo (q \* color'))
> (terminalRadianceSampler surfaces x' nx' ((1-
> q) \* color'))
> sampler
Something like the following should work:
do let x' = x \+ dist \* dir
let nx' = normal geometry
let wi = (-1) \* dir
(p, wo) <- brdfCosSampling reflector nx' wi
let color' = p \** color
let q = min 1 (scalarContribution p)
sampler <- biasedCoinSampler q
(radianceSampler surfaces x' wo (q \* color'))
(terminalRadianceSampler surfaces x' nx' ((1-q) \*
color'))
sampler
- Jake McArthur
More information about the Haskell-Cafe
mailing list