Esempio n. 1
0
        public bool NextVertex(ref SurfaceIntersectionData hit, ref RayData pathRay, ref RgbSpectrum throughput, int depth, out float pdf)
        {
            var currentTriangleIndex = (int)hit.Hit.Index;
            var lt = Scene.GetLightByIndex(currentTriangleIndex);
            var wo = -pathRay.Dir;
            pdf = 1f;
            if (hit.Brdf.IsSpecular() || depth == 1)
            {
                if (lt != null)
                {
                    var le = hit.Color * lt.Emittance(ref wo, out pdf);
                    throughput.MAdd(ref throughput, ref le);
                }
            }

            return false;
        }