Пример #1
0
        static Vector3 GetColor(Hitable world, Ray ray)
        {
            HitResult result = world.Hit(ray);
            Vector3   normal = result.Normal;

            if (result.IsHited)
            {
                return(new Vector3(0.5f * (normal.X + 1),
                                   0.5f * (normal.Y + 1),
                                   0.5f * (normal.Z + 1)));
            }

            return(Camera.GetSkyColor(ray));
        }