Skip to content

SampleF seems to double the pdf #19

@GoogleCodeExporter

Description

@GoogleCodeExporter
Hi again,

It seems to me that SampleF returns the double of the pdf:


When adding 
Pdf += m_Lambertian.Pdf(Wol, Wil);
Pdf += m_Microfacet.Pdf(Wol, Wil);

Pdf is already set and non zero. Furthermore why is here no Importance sampling 
applied.

What I am asking is, could you please tell me the reason behind this.


Regards
Christoph


HOD CColorXyz SampleF(const Vec3f& Wo, Vec3f& Wi, float& Pdf, const 
CBrdfSample& S)
    {
        const Vec3f Wol = WorldToLocal(Wo);
        Vec3f Wil;

        CColorXyz R;

        if (S.m_Component <= 0.5f)
        {
            m_Lambertian.SampleF(Wol, Wil, Pdf, S.m_Dir);
        }
        else
        {
            m_Microfacet.SampleF(Wol, Wil, Pdf, S.m_Dir);
        }

        Pdf += m_Lambertian.Pdf(Wol, Wil);
        Pdf += m_Microfacet.Pdf(Wol, Wil);

        R += m_Lambertian.F(Wol, Wil);
        R += m_Microfacet.F(Wol, Wil);

        Wi = LocalToWorld(Wil);

        return R;
    }

Original issue reported on code.google.com by c.web...@yahoo.de on 13 Jun 2012 at 1:50

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions