New Vulkan example: Indirect drawing

I have added another example to my open source C++ Vulkan examples. The new one is about indirect drawing (including multi draw if supported). Contrary to their non-direct counterparts, the indirect drawing commands in Vulkan take their draw calls from a buffer that is ideally stored in device local memory. So instead of running single draw commands that get their index base, index count and instancing numbers passed by the host upon getting called, the indirect commands are backed by a buffer that stores an arbitrary number of draw commands.

The example renders a huge number of plants with different geometries only using one single draw call. All plants geometries are stored in one buffer, and each indirect draw command uses different index offsets and also does instancing.


indirectdraw


This technique is the based for several GPU-based functions that have traditionally been handled by the CPU. As the draw commands are stored in a buffer that the GPU has access too, it’s now possible to have a compute shader manipulate the draw commands that are issued so the GPU can take on tasks like culling or draw command generation in general.

 

New Vulkan example: Indirect drawing

New Vulkan example: Deferred shading and shadows

Based on the recently updated deferred shading example, I have added a new example to my open source C++ Vulkan samples. This example adds dynamic shadows from multiple light sources, showcasing a few technologies that can be used to make rendering of multiple shadows more efficient.

To achieve this, the example uses a layered depth attachment with one layer per light source that is sampled in the final scene composition. Traditionally one would do multiple passes to render the depth maps for the scene’s light source, and to avoid this the example also uses shader instancing by doing multiple invocations in the geometry shader. The geometry shader then uses the invocation index to output into the different layers of the depth attachment, with the matrices from the different point-of-views of the light sources getting passed as an array.

This is an approach that fits modern GPUs very well and allows for an arbitrary number of shadow casting light sources to be added without the need to add multiple render passes.

 

Video

Updated Vulkan deferred shading example video

Over the past few weeks and months I’ve been constantly working on my Vulkan examples, enhancing existing demos, adding new ones, fixing bugs reported and merging pull requests (thx to anyone that has contributed!). I even found some time to work on a Vulkn deferred shading playground using Crytek’s famous Sponza model. You can find the repository for it here.

This Sunday I decided to visually upgrade the deferred shading example included in my samples repository. Deferred shading is commonly used nowadays, and I felt that the example didn’t showcase the technique properly. And so I went on to add some normal mapped surfaces, render multiple meshes and make the light sources dynamic.

And thanks to nvidia’s ShadowPlay I can even capture the Vulkan samples at nice frame rates, so I decided to upload a small video of the updated example to my YouTube channel:

Continue reading “Updated Vulkan deferred shading example video”

Updated Vulkan deferred shading example video

Khronos Chapter Munich Vulkan Slides

from_gl_to_vulkan_slidedeck

I’ve been speaking about my Vulkan launch day contributions and my experiences moving from OpenGL to Vulkan at the Khronos Munich Chapter Grand Opening last friday at the AMD offices. This was a great event, and finally getting to know some of the people in real was an awesome personal experience. So at this point I’d like to thank all the people that helped make this event happen and all these that attended, had a real blast talking and discussing about Vulkan!

For those interested, I have added my Slides to the Vulkan github repository.

Khronos Chapter Munich Vulkan Slides

Vulkan Examples update

68747470733a2f2f7777772e6b68726f6e6f732e6f72672f6173736574732f75706c6f6164732f617069732f67646673676b6a6834353574342f676c6e6578742d6c6f676f2e706e67

The last few weeks since the Vulkan launch (one month ago) have been pretty busy. I’ve been adding new examples to to my github repository (almost at 30), fixed some bugs (thanks to everyone that has contributed!) and finally added Android support to all examples (removing the few separate Vulkan Android samples).

I also provide pre-built binaries for Windows, Linux and Android (only ARM right now) if you just want to try out the examples at vulkan.gpuinfo.org :

Note : The windows binaries require the media pack (see below) to be present for loading shaders, meshes and textures.

64-Bit Binaries (2016-03-28) ~1.5 MBytes

Note : The linux binaries require the media pack (see below) to be present for loading shaders, meshes and textures.

64-Bit Binaries (2016-03-28) ~1.6 MBytes

Note :Requires a ARM device with Vulkan support. Gamepads are supported.
Assets required (shaders, textures, models) are part of each apk, the media pack is not requried.
The archive contains two batch files for easy installation and removal of all examples at once.

ARM Binaries (2016-03-28) ~51 MBytes

Note : This archive contains all shaders, models and textures requried to run the windows and linux examples. Put the data folder to where the bin folder for windows or linux has been extracted so the examples can find the required assets.

64-Bit Binaries (2016-03-28) ~20 MBytes

Vulkan Examples update

Vulkan is here!

68747470733a2f2f7777772e6b68726f6e6f732e6f72672f6173736574732f75706c6f6164732f617069732f67646673676b6a6834353574342f676c6e6578742d6c6f676f2e706e67

Khronos finally launched Vulkan 1.0!

After 18 months of hard works and a huge industry-wide collaboration, this is a huge success. And this is not only an API-launch, but a hard launch with drivers for Vulkan from NVidia, AMD, Intel, etc. on mulitple platforms.

My launch contributions

Some time ago I was invited to be a part of the Vulkan Advisory Panel board. So I actually got a head-start and also released some Vulkan related stuff to the public on launch day. I even made it onto the Vulkan Launch page and was quoted in a press release by NVIDIA 🙂

Vulkan examples

You can find a bunch of Vulkan examples (C++) over at my github repository. They contain over two dozen examples, and even a few for getting started on Android (if you own Android hardware that supports Vulkan). Feel free to fork and contribute!

Vulkan hardware database

My OpenGL and OpenGL ES hardware database are frequently used (and quoted) by many developers, so I went on and also created a Vulkan Hardware Capability Database (and viewer). Vulkan is a bit more explicit than OpenGL and offers much more information, so once the database is filled with enough hardware reports this should become a valuable resource for developers.

 

Being part of this was a great experience, and I’d like to thank everybody on the Vulkan Working Group and Advisory panel, and the fine people over at LunarG and the IHVs I’ve worked with!

Vulkan is here!

Vulkan specification complete, release imminent

68747470733a2f2f7777772e6b68726f6e6f732e6f72672f6173736574732f75706c6f6164732f617069732f67646673676b6a6834353574342f676c6e6578742d6c6f676f2e706e67

Great news! The Khronos Vulkan Working Group just announced that the specification is complete (and has entered the legal review process) and the release is imminent.

Though the initial time frame of 2015 was missed (by a bit), this should mean that Vulkan will be ready for launch in early 2016. This will include SDKs for all supported platforms, production ready drivers from several IHV, resources, tools, demos, examples and much more.

Continue reading “Vulkan specification complete, release imminent”

Quote

Vulkan related works

 

68747470733a2f2f7777772e6b68726f6e6f732e6f72672f6173736574732f75706c6f6164732f617069732f67646673676b6a6834353574342f676c6e6578742d6c6f676f2e706e67

vulkan

In case you don’t follow me on twitter or aren’t watching my github repositories, I’ve been working on Vulkan related stuff over the last few months. And with Vulkan’s release approaching it’s time for a short summary on what I plan on release upon or shortly after launch of the new graphics and compute API.

Vulkan Hardware Capability Viewer

As with OpenGL and OpenGL ES I’ll also do a Vulkan Hardware Capability viewer (github). It looks (and works) pretty much like the OpenGL hardware capability viewer, also using Qt for the user interface. I plan on release it close to the launch of Vulkan with support for Windows and Linux, while Android support will follow at some later point.

It’ll also come along with an online database, accessible through gpuinfo.org, allowing you to browse devices, features, extensions, etc.

Examples and demos

Learning a new graphics (and compute) API is never easy, especially if you’re just a hobbyist and even more for an explicit API like Vulkan that greatly differs from OpenGL. But even for someone not working full time on some rendering engines  it’s not that hard to learn.

To get you started with Vulkan, and to share what I’ve learned while working with Vulkan I’ll have several open source examples ready for launch. They range from the most basic things (rendering a colored triangle) to more complex things like multi pass offscreen rendering, tessellation and compute shaders.

The examples are written in C++ and should work on Windows and Linux with Android support to follow. The github repository can be found here, though it only contains a listing of the examples with descriptions and screenshots right now. Sources will follow when Vulkan goes public.

Contributing to the Khronos Vulkan resource pages

The Khronos group recently open sourced their web pages, including those for their APIs. Every API now also has a resource page with links to tutorials, SDKs, tools, source, etc. The Vulkan one is pretty sparse right now, so if you know of any interesting links related to Vulkan, feel free to contribute to their repository.

Vulkan related works

Introducing gpuinfo.org

gpuinfoAside from playing around with a certain new API, I’ve also been working on the web front end OpenGL and OpenGL ES hardware database.

Though I redid the visual side of both some time ago they differed too much for my taste and especially the OpenGL ES database was lacking lots compared to the OpenGL one. No live search, bad visuals (especially for the reports), lacking compare features and much more.

So I did put lots of work in getting both database up to the same standards, optimize the visual presentation and also created a landing page at www.gpuinfo.org, that is home to the current hardware databases (OpenGL, OpenGL ES), with at least one new database (Vulkan) coming in the near future.

The OpenGL database is now available at opengl.gpuinfo.org. New features include a list of maximum supported OpenGL version by device and listing of compressed texture formats for comparing multiple reports.

The OpenGL ES database is located at opengles.gpuinfo.org. Aside from the complete visual overhaul, it now offers (mostly) the same functionality as the OpenGL database. All tables now support a live search (thanks to datatables), report information is now presented in tabs and the launch page has been replaced by a report listing like the one on the OpenGL database.

Source for all the pages (including gpuinfo.org) are available at my github repository, so if you find any bugs feel free to report them there.

Introducing gpuinfo.org