Esempio n. 1
0
        public void Le(ref Vector wo, out float pdf, ref RgbSpectrum spd)
        {
            pdf = 1f / area;

            if (Normal.Dot(ref TriangleNormal, ref wo) <= 0f)
            {
                spd.Mul(0f);
                return;
            }
            spd.Mul(ref lightSpectra);
        }
Esempio n. 2
0
        public void Le(ref Vector wo, out float pdf, ref RgbSpectrum spd)
        {
            var ti = SampleTriangleIndex();
            var sampleN = triangleSampleData[ti].Item2;
            var area = triangleSampleData[ti].Item1;
            pdf = (1f / area) * (1f / mesh.TrianglesCount);
            if (Normal.Dot(ref sampleN, ref wo) <= 0f)
            {
                spd.Mul(0f);
                return;
            }

            var s = GlobalConfiguration.Instance.SpectralRendering ? (ISpectrum)spectra : gain; // Light sources are supposed to have flat color
            spd.Mul(ref s);

        }