[Bf-cycles] build with OSL support

Brecht Van Lommel brechtvanlommel at pandora.be
Fri Nov 11 12:56:21 CET 2011


Hi,

On Thu, Nov 10, 2011 at 7:30 PM, storm <kartochka22 at yandex.ru> wrote:
> Wrong, Diffuse uses uniform sampler, you need patch to make it
> importance sampling.
>
> Patch just add function, you need to uncomment call to
> sample_cos_hemisphere_importance() by hands in bsdf_diffuse.h to see
> difference. No big changes on my test scenes, except it work worse in
> the case distant light close to bumpy surface, long shadows from bumps
> render with more noise, but it expected, as importance sampling fire
> less rays in angles close to surface and more when we close to normal
> direction.

I'm pretty sure diffuse uses cosine weighted sampling? Because eval
and pdf have the same value, they cancel out, and so it must be
sampling exactly the cosine weighted distribution, otherwise it would
be giving wrong results. The sample_cos_hemisphere_importance function
you give here has a constant pdf, which seems to indicate it is
uniform?

As a side note, when comparing to pbrt or some other render engines,
we do something a bit different, we include the cos(theta) factor
already in the BSDF instead of multiplying by it afterwards in the
integrator.

Brecht.


More information about the Bf-cycles mailing list