Prerequisites for texture drawing
Implementing textures is easy and requires only a few steps. Let's have a quick overview of this first, then we will take a deep dive into it:
- Texture coordinates: Textures are glued to the geometry surfaces using texture coordinates. For each vertex, there is a corresponding texture coordinate attached. In our implementation, we specified the vertices and texture coordinates in an interleaved form.
- The shader stage: The vertex and fragment shader are modified to bound the texture resources. The shader stage allows the fragment shader to access the texture resource and paint the fragments. Textures are shared in the form of a sampler at the shader stage.
- Loading the image files: Parse the image files and load the ...
Get Learning Vulkan 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.