Esempio n. 1
0
        public void Render(Camera camera, Scene scene, string outputFileName)
        {
            WriteRenderInfo(camera);
            var nmd = new NormalMapDebugger(camera, scene);

            SceneDistanceBuffer = new SceneDistanceBuffer(camera, scene);
            SceneDistanceBuffer.SaveToFile();
            Status     = new RenderStatus(camera.DevicePixelHeight);
            Raymarcher = new Raymarcher(scene, SceneDistanceBuffer);
            var nCores = Environment.ProcessorCount;
            var yLines = Enumerable.Range(0, camera.DevicePixelHeight).ToList();

            Parallel.ForEach(yLines, (y) => RenderRow(camera, scene, y));
            Console.WriteLine();
            camera.SaveToFile(outputFileName);
        }
Esempio n. 2
0
 public Raymarcher(Scene scene, SceneDistanceBuffer sdb)
 {
     this.Scene       = scene;
     this.SDB         = sdb;
     MinMarchDistance = sdb.PixelSize / 16;
 }