GithubHelp home page GithubHelp logo

vkrenderertools's Introduction

RenderTools


Updated 10.16

The first goal on the TODO list has been accomplished.

  • Fill the depth/stencil attachment and set it as input attachment in the first subpass
  • Read the input attachment in the second subpass.
    I will upload the code after I fix the blurry panel.

image

This project is based on Sascha Willems's demo framework which is in the base directory.

image

Debug overdraw

Rendering scene with multiple lights may lead to severe overdraw problems in forward rendering.
To count the number of times that fragment shader shade a pixel when rendering the scene,
setting up stencil test for the Sponza scene rendering pipeline as the following:

depthStencilStateCI.stencilTestEnable = VK_TRUE;
depthStencilStateCI.front.compareOp = VK_COMPARE_OP_ALWAYS;
depthStencilStateCI.front.compareMask = 0xff;
depthStencilStateCI.front.writeMask = 0xff;
depthStencilStateCI.front.depthFailOp = VK_STENCIL_OP_INCREMENT_AND_CLAMP;
depthStencilStateCI.front.passOp = VK_STENCIL_OP_INCREMENT_AND_CLAMP;

TODOs

  • Visualize different stencil values on the screen
  • Use the same renderpass when rendering shadow map?

image

ZPrepass

To investigate the methods to reduce overdraw,
enabling the early fragment test in the scene rendering fragment shader by

layout (early_fragment_tests) in;

Add a depth prepass as well before scene rendering with an empty fragment shader to fill the depth buffer. By turning the prepass on, the framerate gets increased stably to 180-190fps as shown in the screenshot.

image

Notice

You can select your GPU in the line 1022 by modifying the code in .\base\vulkanexamplebase.cpp.

        ...
1022    uint32_t selectedDevice  = 1;
        ...

The variable selectedDevice is 1 for default. You can change it to 0 in case:

  • You want to switch to another GPU
  • You only have only one GPU and the program crashes at the GPU selection.

vkrenderertools's People

Contributors

saschawillems avatar srsaunders avatar ben-clayton avatar gadgeteering avatar alberthuang96 avatar ekzuzy avatar elect86 avatar billhollings avatar robotchaox avatar jherico avatar iostrowsintel avatar jonnxie avatar chrisforbes avatar tomek-brcm avatar baldurk avatar natevm avatar per-mathisen-arm avatar aleksy-sokolowski avatar thochstein avatar 1ace avatar dcbaker avatar christianf-arm avatar roboman2444 avatar hevrard avatar krooze avatar yanchith avatar kuhar avatar prideout avatar gary-sweet avatar shoufengyang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.