Giter VIP home page Giter VIP logo

michal2229 / vulkanplayground Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 954.39 MB

My Vulkan 3D API playground (C++ ), based on Sascha Willems's work (https://github.com/SaschaWillems/Vulkan).

License: GNU General Public License v3.0

CMake 5.61% Batchfile 0.11% GLSL 17.86% Shell 0.74% C++ 75.69%
vulkan-api vulkan 3d-graphics computer-graphics learning-by-doing shaders pipelines descriptors buffers matrices

vulkanplayground's Introduction

README

My Vulkan API playground, written in C++, based on Sascha Willems's work.

I like tinkering with programming and 3D graphics, so I chose to learn Vulkan, and this repository is intended to help me with it. Probably I wouldn't dare to start doing this without examples and tools written by Sascha Willems, also articles/twitter threads from Stephanie Hurlburt helped me a lot. I am not an artist, so please pardon lack of proper scene design, etc.
I try to keep track of my progress, make goals and tasks, mark bugs etc., what can be seen under Issues/Milestones tab.
More info in individual example's folder's readme, on other branches and on wiki page.
There is a separate branch dedicated to working on assets and other resources.
Any suggestions and comments are very welcome!

My examples

Info about Vulkan API

Info from Khronos

Vulkan is a new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.

Info from Wikipedia

Vulkan is a low-overhead, cross-platform 3D graphics and compute API. Vulkan targets high-performance realtime 3D graphics applications such as video games and interactive media across all platforms. Compared with OpenGL and Direct3D 11 and like Direct3D 12 and Mantle, Vulkan is intended to offer higher performance and more balanced CPU/GPU usage. Other major differences from Direct3D 11 (and prior) and OpenGL are Vulkan being a considerably lower level API and offering parallel tasking. Vulkan also has the ability to render 2D graphics applications, however it is generally suited for 3D. In addition to its lower CPU usage, Vulkan is also able to better distribute work amongst multiple CPU cores.

Vulkan was first announced by the Khronos Group at GDC 2015. The Vulkan API was initially referred to as the "next generation OpenGL initiative," or "OpenGL next" by Khronos, but use of those names was discontinued once the Vulkan name was announced. Vulkan is derived from and built upon components of AMD's Mantle API, which was donated by AMD to Khronos with the intent of giving Khronos a foundation on which to begin developing a low-level API that they could standardize across the industry, much like OpenGL.

Info from Nvidia

Vulkan is a modern cross-platform graphics and compute API currently in development by the Khronos consortium. The Khronos members span the computing industry and are jointly creating an explicit and predictable API that satisfies the needs of software vendors in fields as varied as game, mobile and workstation development. Vulkan's conscious API design enables efficient implementations on platforms that span a wide range of mobile and desktop hardware as well as across operating systems.

Info from AMD

Vulkan™ supports close-to-metal control enabling faster performance and better image quality across Windows® 7, Windows® 8.1, Windows® 10, and Linux®. No other graphics API offers the same powerful combination of OS compatibility, rendering features, and hardware efficiency.

Developed by the Khronos Group, the same consortium that developed OpenGL®, Vulkan™ is a descendant of AMD’s Mantle, inheriting a powerful low-overhead architecture that gives software developers complete access to the performance, efficiency, and capabilities of Radeon™ GPUs and multi-core CPUs.

Compared to OpenGL, Vulkan™ substantially reduces “API overhead” – the background work a CPU does to interpret what a game asks of the hardware – to deliver meaningful features, performance, and image quality and expose GPU hardware features that wouldn’t ordinarily be accessible through OpenGL.

Info from Intel

Vulkan is seen as an OpenGL’s successor. It is a multiplatform API that allows developers to prepare high-performance graphics applications likes games, CAD tools, benchmarks, and so forth. It can be used on different operating systems like Windows*, Linux*, or Android*. The Khronos consortium created and maintains Vulkan. Vulkan also shares some other similarities with OpenGL, including graphics pipeline stages, GLSL shaders (sort of) or nomenclature.

(...)

Vulkan was based on Mantle*—the first in a series of new low-level graphics APIs. Mantle was developed by AMD and designed only for the architecture of Radeon cards. And despite it being the first publicly available API, games and benchmarks that used Mantle saw some impressive performance gains. Then other low-level APIs started appearing, such as Microsoft’s DirectX* 12, Apple’s Metal* and now Vulkan.

(...)

In low-level APIs the developer is the one who must take care of most things. They are required to adhere to strict programming and usage rules and also must write much more code. But this approach is reasonable. The developer knows what they want to do and what they want to achieve. The driver does not, so with traditional APIs the driver has to make additional effort for the program to work properly. With APIs like Vulkan this additional effort can be avoided. That’s why DirectX 12, Metal, or Vulkan are called thin-drivers/thin-APIs. Mostly they only communicate user requests to the hardware, providing only a thin abstraction layer of the hardware itself. The driver does as little as possible for the sake of much higher performance.

(...)

Resources

vulkanplayground's People

Contributors

michal2229 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

cappah

vulkanplayground's Issues

Unstable simulation when freezing execution on breakpoint

After continuing execution again, the frame timer has very large value, which forces sim to place simulated object very far, according to its velocity and this frame time.
A fix would be to set arbitrary value of frame timer (ie 0.1s, which corresponds to 10fps), when it becomes too large.
It will help also on low framerate situations.

Make zoom-in intro

Camera animation to perform on start, after intro camera should be controllable as before.

New example: I. analysis phase

Requirements:

  • easy to further extend, add new models, behaviours, logic, interactivity
  • elastic in implementation, easy to add new stuff
  • clean, logical, simple
  • nice looking, good quality models and textures
  • no more than 100k verts per model for max 10 models (or no more than 1M verts per scene)
  • dynamic changing number of instances rendered
  • some physical sim
  • it should show most of physical phenomena:
    • shadows // offscreen rendering of depth from light's POV, then passing it into shaders
    • indirect lighting
    • ambient occlusion
    • reflection
    • refraction
    • transparency
    • image projection lighting
    • bloom
  • it should use advanced techniques
    • normal mapping
    • tesselation
    • bump mapping
    • parallax mapping
    • environment mapping
    • fresnel effect
    • metallness property // what type of reflection is it
    • roughness property // how much the reflection is blurred
    • glossiness property // how much the surface reflects the light
    • transparency // how much refraction there will be instead of reflection + diffuse
    • additional clear coat effect
    • index of refraction property

Vulkan validation layer can not be turned on - error on runtime

Log from runtime:

Starting VulkanPlayground/bin/instancing-229...
int main(const int argc, const char *argv[])
VkResult VulkanExampleBase::createInstance(bool enableValidation)
VkResult VulkanExampleBase::createInstance(bool enableValidation)
Could not create Vulkan instance :
ERROR_LAYER_NOT_PRESENT
VulkanPlayground/bin/instancing-229 exited with code 1

It does not work too when running setup-env.sh from LunarSDK first, and then running binary - behavior is the same.

VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_standard_validation ./instancing-229 does not help either.

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.