Esempio n. 1
0
 internal void Render(Scene scene)
 {
     for (int y = 0; y < screenHeight; y++)
     {
         for (int x = 0; x < screenWidth; x++)
         {
             Color color = TraceRay(new Ray()
             {
                 Start = scene.Camera.Pos, Dir = GetPoint(x, y, scene.Camera)
             }, scene, 0);
             setPixel(x, y, color.ToDrawingColor());
         }
     }
 }
Esempio n. 2
0
        internal void Render(Scene scene)
        {
            for (int y = 0; y < screenHeight; y++)
            {
                if (LineRendered != null)
                {
                    LineRendered(this, EventArgs.Empty);
                }

                for (int x = 0; x < screenWidth; x++)
                {
                    Color color = TraceRay(new Ray {
                        Refraction = 1, Start = scene.Camera.Pos, Dir = GetPoint(x, y, scene.Camera)
                    }, scene, 0);
                    setPixel(x, y, color.ToDrawingColor());
                }
            }
        }