Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Resolution            renderResolution = new Resolution(960, 540);
            Resolution            windowSize       = new Resolution(960, 540);
            GraphicsDeviceOptions gdOptions        = new GraphicsDeviceOptions()
            {
                Debug = false,
                SwapchainDepthFormat = PixelFormat.R16_UNorm,
                SyncToVerticalBlank  = false,
                ResourceBindingModel = ResourceBindingModel.Improved //TODO
            };

            RenderOptions rdOptions = new RenderOptions()
            {
                PreferredGraphicsBackend    = GraphicsBackend.OpenGL,
                UsePreferredGraphicsBackend = false,
                LimitFrames = true,
                FPSTarget   = 60.0
            };


            OffscreenScene scene = new OffscreenScene(
                "Offscreen",
                windowSize,
                gdOptions,
                rdOptions
                );

            var gui = new StandardGUIOverlay(scene.GraphicsDevice, renderResolution);

            scene.SetUI(gui);

            scene.SetUp(renderResolution);
            scene.Run();
        }
Exemplo n.º 2
0
        public override void createScene(GraphicsBackend graphicsBackend, Sdl2Window contextWindow = null)
        {
            Resolution            renderResolution = new Resolution(960, 540);
            Resolution            windowSize       = new Resolution(960, 540);
            GraphicsDeviceOptions gdOptions        = new GraphicsDeviceOptions()
            {
                Debug = false,
                SwapchainDepthFormat = PixelFormat.R16_UNorm,
                SyncToVerticalBlank  = false,
                ResourceBindingModel = ResourceBindingModel.Improved
            };

            RenderOptions rdOptions = new RenderOptions()
            {
                PreferredGraphicsBackend    = graphicsBackend,
                UsePreferredGraphicsBackend = true,
                LimitFrames = true,
                FPSTarget   = 60.0
            };

            scene = contextWindow == null ? new AssetLoadingScene(
                "Asset Loading",
                windowSize,
                gdOptions,
                rdOptions
                ) : new AssetLoadingScene(
                "Asset Loading",
                windowSize,
                gdOptions,
                rdOptions
                );

            gui = new StandardGUIOverlay(scene.GraphicsDevice, renderResolution);
            scene.SetUI(gui);
            gui.changeBackendAction += ChangeBackend;

            //scene.PreRender_Models += BuildBVH;
            //scene.PreDraw_Time_GraphicsDevice_CommandList_Camera_Models += EnableBVHCulling;

            scene.CreateShadowMap(renderResolution);
            scene.SetUp(renderResolution);
            scene.Run();
        }
Exemplo n.º 3
0
        public override void createScene(GraphicsBackend graphicsBackend, Sdl2Window contextWindow = null)
        {
            Resolution            renderResolution = new Resolution(960, 540);
            Resolution            windowSize       = new Resolution(960, 540);
            GraphicsDeviceOptions gdOptions        = new GraphicsDeviceOptions()
            {
                Debug = false,
                SwapchainDepthFormat = PixelFormat.R16_UNorm,
                SyncToVerticalBlank  = true,
                ResourceBindingModel = ResourceBindingModel.Improved
            };

            RenderOptions rdOptions = new RenderOptions()
            {
                Resolution = renderResolution,
                PreferredGraphicsBackend    = graphicsBackend,
                UsePreferredGraphicsBackend = true,
                LimitFrames = true,
                FPSTarget   = 60.0
            };

            scene = contextWindow == null ? new LightsScene(
                "Lights",
                windowSize,
                gdOptions,
                rdOptions
                ) : new LightsScene(
                "Lights",
                windowSize,
                gdOptions,
                rdOptions
                );

            gui = new StandardGUIOverlay(scene.GraphicsDevice, renderResolution);
            scene.SetUI(gui);
            gui.changeBackendAction += ChangeBackend;

            scene.CreateShadowMap(renderResolution);
            scene.SetUp(renderResolution);
            scene.Run();
        }
Exemplo n.º 4
0
        public override void createScene(GraphicsBackend graphicsBackend, Sdl2Window contextWindow = null)
        {
            Resolution            renderResolution = new Resolution(960, 540);
            Resolution            windowSize       = new Resolution(960, 540);
            GraphicsDeviceOptions gdOptions        = new GraphicsDeviceOptions()
            {
                Debug = false,
                SwapchainDepthFormat = PixelFormat.R32_Float,
                SyncToVerticalBlank  = false,
                ResourceBindingModel = ResourceBindingModel.Improved
            };

            RenderOptions rdOptions = new RenderOptions()
            {
                Resolution = renderResolution,
                PreferredGraphicsBackend    = graphicsBackend,
                UsePreferredGraphicsBackend = true,
                LimitFrames = false,
                FPSTarget   = 60.0,
                FarPlane    = 500.0f
            };

            scene = new SponzaScene(
                "Sponza",
                windowSize,
                gdOptions,
                rdOptions
                );

            gui = new StandardGUIOverlay(scene.GraphicsDevice, renderResolution);
            scene.SetUI(gui);
            gui.changeBackendAction += ChangeBackend;

            scene.PreRender_Descriptors           += BuildBVH;
            scene.PreDraw_Time_Camera_Descriptors += EnableBVHCulling;

            scene.CreateShadowMap(renderResolution);
            scene.SetUp(renderResolution);
            scene.Run();
        }