- Prepare the Vulkan resources as described in the Rendering a geometry with a vertex diffuse lighting recipe.
- Load the 3D models with vertex positions and normal vectors. Store loaded data in a (vertex) buffer.
- Create a uniform buffer with VK_BUFFER_USAGE_TRANSFER_DST_BIT and VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT usages that are big enough to hold data for three 16-element matrices of floating-point values (refer to the Creating a uniform buffer recipe from Chapter 5, Descriptor Sets).
- Create a staging buffer supporting a VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage, which is able to hold data for three matrices each with 16 floating-point elements. The buffer's memory object should be allocated on a memory that is host-visible (refer ...
How to do it...
Get Vulkan Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.