You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update Vulkan code to use RAII and modern Vulkan-Hpp bindings
Refactor code to replace raw Vulkan handles with RAII wrappers from Vulkan-Hpp for better resource management and safety. Key changes include RAII usage for buffers, images, and device memory, along with modernized function calls and parameter handling. Code readability and alignment with updated Vulkan practices were also improved.
Copy file name to clipboardExpand all lines: en/08_Loading_models.adoc
+13-40Lines changed: 13 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,47 +5,20 @@
5
5
== Introduction
6
6
7
7
Your program is now ready to render textured 3D meshes, but the current geometry in the `vertices` and `indices` arrays is not very interesting yet.
8
-
In this chapter we're going to extend the program to load the vertices and indices from an actual model file to make the graphics card actually do some work.
8
+
In this chapter, we're going to extend the program to load the vertices and indices from an actual model file to make the graphics card actually do some work.
9
9
10
10
Many graphics API tutorials have the reader write their own OBJ loader in a chapter like this.
11
11
The problem with this is that any remotely interesting 3D application will soon require features that are not supported by this file format, like skeletal animation.
12
12
We _will_ load mesh data from an OBJ model in this chapter, but we'll focus more on integrating the mesh data with the program itself rather than the details of loading it from a file.
13
13
14
-
== Library
15
-
16
-
We will use the https://github.com/syoyo/tinyobjloader[tinyobjloader] library to load vertices and faces from an OBJ file.
17
-
It's fast and it's easy to integrate because it's a single file library like stb_image.
18
-
Go to the repository linked above and download the `tiny_obj_loader.h` file to a folder in your library directory.
19
-
20
-
*Visual Studio*
21
-
22
-
Add the directory with `tiny_obj_loader.h` in it to the `Additional Include Directories` paths.
23
-
24
-
image::/images/include_dirs_tinyobjloader.png[]
25
-
26
-
*Makefile*
27
-
28
-
Add the directory with `tiny_obj_loader.h` to the include directories for GCC:
In this chapter we won't be enabling lighting yet, so it helps to use a sample model that has lighting baked into the texture.
16
+
In this chapter, we won't be enabling lighting yet, so it helps to use a sample model that has lighting baked into the texture.
44
17
An easy way to find such models is to look for 3D scans on https://sketchfab.com/[Sketchfab].
45
18
Many of the models on that site are available in OBJ format with a permissive license.
46
19
47
-
For this tutorial I've decided to go with the https://sketchfab.com/3d-models/viking-room-a49f1b8e4f5c4ecf9e1fe7d81915ad38[Viking room] model by https://sketchfab.com/nigelgoh[nigelgoh] (https://web.archive.org/web/20200428202538/https://sketchfab.com/3d-models/viking-room-a49f1b8e4f5c4ecf9e1fe7d81915ad38[CC BY 4.0]).
48
-
I tweaked the size and orientation of the model to use it as a dropin replacement for the current geometry:
20
+
For this tutorial, I've decided to go with the https://sketchfab.com/3d-models/viking-room-a49f1b8e4f5c4ecf9e1fe7d81915ad38[Viking room] model by https://sketchfab.com/nigelgoh[nigelgoh] (https://web.archive.org/web/20200428202538/https://sketchfab.com/3d-models/viking-room-a49f1b8e4f5c4ecf9e1fe7d81915ad38[CC BY 4.0]).
21
+
I tweaked the size and orientation of the model to use it as a drop-in replacement for the current geometry:
0 commit comments