Git Product home page Git Product logo

littlevulkanengine's Introduction

Little Vulkan Engine

A video tutorial series introducing computer graphics for Vulkan®, the new generation graphics and compute API from Khronos.

Currently this repository is more for use as a reference and for my own use to track the progress of this series, rather than something that can be cloned and used as a starting point, at least until I make a more robust build system.

Table of Contents

Building

This repository is still in the early stages and doesn't contain everything you may need to compile and build the code on your machine. If you wish to use this as a starting point for your project my recommendation is to follow the tutorial series. Any contributions to making a more robust, multi-platform build system are appreciated :)

Tutorials

Basics

This is the staring point to the tutorial series. It is equivalent to where you'd be at if you completed the linux section of setting up your development environment as described by Vulkan Tutorial with just a few small changes.

Video Tutorial

In the very first tutorial of this series we will be creating a class to encapsulate a glfw window, and a class to run our application.

Video Tutorial

In this tutorial we create the most basic of vertex and fragment shaders files, go over how to compile them to SPIR-V, and read the compiled files into our c++ program, to later be used to create shader modules in the next tutorial.

Video Tutorial

In this tutorial we configure our graphics pipeline create info to prepare our pipeline for drawing. We read in the compiled shader files created in the previous tutorial and use them to create shader modules. We also have added the lve_device helper file which encapsulates a vulkan device and functionality for creating a vulkan instance, setting up validation layers, picking a physical device and creating a logical device and queues. Additionally, there is a bit of helper functionality.

Tutorial 03 Video

Tutorial 04 Video

We finally draw a triangle!! In this tutorial we cover command buffers and give a brief overview of the swap chain, and the initial functionality we will be using to draw to a window.

Video Tutorial - Part 1

Video Tutorial - Part 2

In this tutorial, we will cover how vertex buffers store data, and can be bound to graphics pipelines. A vertex buffer is really just a chunk of memory that we pass into our vertex shader. We can put whatever data we would like into this memory as long as we tell our graphics pipeline how it is structured.

Tutorial 06 Video

We update the vertex struct and buffer to include an additional color attribute. We then use the color attribute to demonstrate fragment interpolation for values output from the vertex shader to the fragment shader.

Tutorial 07 Video

We set up a callback function that listens to changes on the glfw window and updates the dimensions of the window wrapper class. When the window is resized we must create a new compatible swap chain.

Tutorial 08 Video

Vulkan Push constants are an easy and performant way to pass data to a shader, via a vulkan command buffer rather than writes to memory or copy commands. They’re a great option for data that updates frequently, however have a main drawback of being limited in size.

Tutorial 09 Video

Matrices are an incredibly useful tool for representing linear transformations on geometry. In this tutorial we cover 2d transformation matrices and use them in our shaders to stretch, shrink and rotate our vertex position.

Tutorial 10 Video

This is a coding focused tutorial with not much theory. We restructure our application class by creating a Renderer class and a SimpleRenderSystem class. This modular and flexible design should make implementing many future topics possible and easy to integrate into the engine.

Tutorial 11 Video

We finally moved to 3D! In this tutorial we update the engine to use 3D positions and homogeneous coordinates, opening the possibility to more complicated transformation matrices.

Tutorial 12 Video

We implement functions to create the orthographic projection and the perspective projection matrices. Projection matrices change the shape and location of vulkan’s canonical view volume.

Tutorial 13 Video

We implement the camera/view transform. This allows us to place a virtual camera anywhere within the game world, which makes it possible to control what is captured by the viewing frustum and displayed to the screen.

Tutorial 14 Video

Getting user input and time loops are both integral parts to any game engine and are complex topics. In this tutorial I briefly introduce the concepts and we add the ability to dynamically move the camera in a frame rate independent way.

Tutorial 15 Video

Index buffers are a way to reduce the amount of gpu memory required to store a model’s attribute data by allowing duplicate vertex data to be removed from the Vertex Buffer.

Tutorial 16 Video

In this tutorial we make use of tinyobjloader, a tiny but powerful single file wavefront obj loader, to load 3D models into the engine.

Tutorial 17 Video

We implement a diffuse lighting model with a constant ambient light term in the vertex shader. This colors the vase object by calculating the intensity of light for each vertex based on how directly the surface at the point faces the incoming light.

Tutorial 18 Video

We create a buffer abstraction to make working with buffers a bit more convenient. We replace existing usages (vertex and index buffers) with this new abstraction, and then create a uniform buffer object which will store read-only data that can be updated dynamically between frames, to pass additional data to our shaders.

Tutorial 19 Video

Official Khronos Vulkan Samples

Khronos made an official Vulkan Samples repository available to the public (press release).

You can find this repository at https://github.com/KhronosGroup/Vulkan-Samples

Credits

Thanks to the authors of these libraries :

Thanks to LunarG

Thanks to the wonderful opensource examples by Sascha Willems

Thanks to ThinMatrix and his wonderful OpenGL game tutorial series which was a huge inspiration for this series and how I first started learning computer graphics

Thanks to Sean Plott and the #DK30 challenge, for providing the motivating kick to give this a shot

Attributions / Licenses

littlevulkanengine's People

Contributors

blurrypiano 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.