Beispiel #1
0
        protected override void initVulkan()
        {
            base.initVulkan();

#if DEBUG
            dbgRepport = new DebugReport(instance,
                                         VkDebugReportFlagsEXT.ErrorEXT
                                         | VkDebugReportFlagsEXT.DebugEXT
                                         | VkDebugReportFlagsEXT.WarningEXT
                                         | VkDebugReportFlagsEXT.PerformanceWarningEXT
                                         );
#endif

            camera = new Camera(Utils.DegreesToRadians(45f), 1f, 0.1f, 16f);
            camera.SetPosition(0, 0, 2);

            renderer = new DeferredPbrRenderer(dev, swapChain, presentQueue, cubemapPathes[2], camera.NearPlane, camera.FarPlane);
            renderer.LoadModel(transferQ, modelPathes[curModelIndex]);
            camera.Model = Matrix4x4.CreateScale(1f / Math.Max(Math.Max(renderer.modelAABB.Width, renderer.modelAABB.Height), renderer.modelAABB.Depth));

            statPool = new PipelineStatisticsQueryPool(dev,
                                                       VkQueryPipelineStatisticFlags.InputAssemblyVertices |
                                                       VkQueryPipelineStatisticFlags.InputAssemblyPrimitives |
                                                       VkQueryPipelineStatisticFlags.ClippingInvocations |
                                                       VkQueryPipelineStatisticFlags.ClippingPrimitives |
                                                       VkQueryPipelineStatisticFlags.FragmentShaderInvocations);

            timestampQPool = new TimestampQueryPool(dev);

            init_crow_commands();

            crow.Load("#deferred.menu.crow").DataSource = this;
        }
Beispiel #2
0
        protected override void initVulkan()
        {
            base.initVulkan();

#if DEBUG
            dbgmsg = new vke.DebugUtils.Messenger(instance, VkDebugUtilsMessageTypeFlagsEXT.PerformanceEXT | VkDebugUtilsMessageTypeFlagsEXT.ValidationEXT | VkDebugUtilsMessageTypeFlagsEXT.GeneralEXT,
                                                  VkDebugUtilsMessageSeverityFlagsEXT.InfoEXT |
                                                  VkDebugUtilsMessageSeverityFlagsEXT.WarningEXT |
                                                  VkDebugUtilsMessageSeverityFlagsEXT.ErrorEXT |
                                                  VkDebugUtilsMessageSeverityFlagsEXT.VerboseEXT);
#endif

            camera = new Camera(Utils.DegreesToRadians(45f), 1f, 0.1f, 16f);
            camera.SetPosition(0, 0, -2);

            //renderer = new DeferredPbrRenderer (presentQueue, cubemapPathes[2], swapChain.Width, swapChain.Height, camera.NearPlane, camera.FarPlane);
            renderer = new DeferredPbrRenderer(presentQueue, cubemapPathes[2], swapChain.Width, swapChain.Height, camera.NearPlane, camera.FarPlane);
            renderer.LoadModel(transferQ, modelPathes[curModelIndex]);
            foreach (Model.Mesh mesh in renderer.model.Meshes)
            {
                Console.WriteLine(mesh.Name);
            }
            camera.Model = Matrix4x4.CreateScale(1f / Math.Max(Math.Max(renderer.modelAABB.Width, renderer.modelAABB.Height), renderer.modelAABB.Depth));

            init_final_pl();
        }
Beispiel #3
0
        Deferred() : base(true)
        {
            if (Instance.DEBUG_UTILS)
            {
                dbgRepport = new DebugReport(instance,
                                             VkDebugReportFlagsEXT.ErrorEXT
                                             | VkDebugReportFlagsEXT.DebugEXT
                                             | VkDebugReportFlagsEXT.WarningEXT
                                             | VkDebugReportFlagsEXT.PerformanceWarningEXT
                                             );
            }

            camera = new Camera(Utils.DegreesToRadians(45f), 1f, 0.1f, 16f);
            camera.SetPosition(0, 0, 2);

            renderer = new DeferredPbrRenderer(dev, swapChain, presentQueue, cubemapPathes[2], camera.NearPlane, camera.FarPlane);
            renderer.LoadModel(transferQ, modelPathes[curModelIndex]);
            camera.Model = Matrix4x4.CreateScale(1f / Math.Max(Math.Max(renderer.modelAABB.Width, renderer.modelAABB.Height), renderer.modelAABB.Depth));
        }
Beispiel #4
0
        public override void Update()
        {
            if (reloadModel)
            {
                renderer.LoadModel(transferQ, vke.samples.Utils.GltfFiles[curModelIndex]);
                reloadModel         = false;
                camera.Model        = Matrix4x4.CreateScale(1f / Math.Max(Math.Max(renderer.modelAABB.Width, renderer.modelAABB.Height), renderer.modelAABB.Depth));
                updateViewRequested = true;
                rebuildBuffers      = true;
#if WITH_SHADOWS
                renderer.shadowMapRenderer.updateShadowMap = true;
#endif
            }

            if (rebuildBuffers)
            {
                buildCommandBuffers();
                rebuildBuffers = false;
            }
        }
Beispiel #5
0
        public override void Update()
        {
            if (reloadModel)
            {
                renderer.LoadModel(transferQ, modelPathes[curModelIndex]);
                reloadModel         = false;
                camera.Model        = Matrix4x4.CreateScale(1f / Math.Max(Math.Max(renderer.modelAABB.Width, renderer.modelAABB.Height), renderer.modelAABB.Depth));
                updateViewRequested = true;
                rebuildBuffers      = true;
#if WITH_SHADOWS
                renderer.shadowMapRenderer.updateShadowMap = true;
#endif
            }

            base.Update();

            if (++frameCount > 20)
            {
                NotifyValueChanged("fps", fps);
                frameCount = 0;
            }

            results = statPool.GetResults();
        }