Skip to content

Commit c351963

Browse files
committed
Fix typos
1 parent c402edb commit c351963

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

bookcontents/chapter-08/chapter-08.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public class ModelLoader {
105105
}
106106
```
107107

108-
We first check if the path to the 3D model and the texture directory exist. After that, we import the 3D model by invoking the `aiImportFile` Assimp function which will return an `AIScene` structure. Then, we use the `AIScene` structure to load the 3D models materials. We get the total number of materials allocating as many structures of `AIMaterial` as needed. The material will hold information related to the textures and colors for each mesh. For each of the materials we extract the values that we will need by calling the `processMaterial` method. The next step is to load the meshes data by calling the `processMesh` method. As in the case of materials, we get the total number of meshes that the `AIScene` contains and allocate as many `AIMesh` structure as needed. Once we have finished processing the model we just release the `AIScene` and return the array of the meshes present in the model. Let's analyze first the `processMaterial` method:
108+
We first check if the path to the 3D model and the texture directory exists. After that, we import the 3D model by invoking the `aiImportFile` Assimp function which will return an `AIScene` structure. Then, we use the `AIScene` structure to load the 3D models materials. We get the total number of materials allocating as many structures of `AIMaterial` as needed. The material will hold information related to the textures and colors for each mesh. For each of the materials we extract the values that we will need by calling the `processMaterial` method. The next step is to load the meshes data by calling the `processMesh` method. As in the case of materials, we get the total number of meshes that the `AIScene` contains and allocate as many `AIMesh` structure as needed. Once we have finished processing the model we just release the `AIScene` and return the array of the meshes present in the model. Let's analyze first the `processMaterial` method:
109109

110110
```java
111111
public class ModelLoader {
@@ -198,7 +198,7 @@ public class ModelData {
198198
...
199199
```
200200

201-
Going back to the `ModelLoader`class, the remaining methods are quite simple, we just extract the position and texture coordinates and the indices:
201+
Going back to the `ModelLoader` class, the remaining methods are quite simple, we just extract the position and texture coordinates and the indices:
202202

203203
```java
204204
public class ModelLoader {
@@ -398,7 +398,7 @@ public class Texture {
398398
}
399399
```
400400

401-
In order for Vulkan to correctly use the image, we need to transition it to the correct layout an copy the staging buffer contents to the image.This is done in the `recordTextureTransition` method.
401+
In order for Vulkan to correctly use the image, we need to transition it to the correct layout an copy the staging buffer contents to the image. This is done in the `recordTextureTransition` method.
402402

403403
```java
404404
public class Texture {
@@ -503,7 +503,7 @@ In the second case, the second `if` condition will be executed. We use the `VK_A
503503

504504
Once the conditions has been set we record the image pipeline barrier by invoking the `vkCmdPipelineBarrier` function.
505505

506-
The only missing method in t he `Texture` class is the `recordCopyBuffer`:
506+
The only missing method in the `Texture` class is the `recordCopyBuffer`:
507507

508508
```java
509509
public class Texture {
@@ -590,7 +590,7 @@ public class EngineProperties {
590590
}
591591
```
592592

593-
Back to the `TextureCache` class, the rest of the methods are the classical `cleanup` method to free the images and the `getTexture` method to be able to retrieve one already created `Texture` using is file path and through their position.
593+
Back to the `TextureCache` class, the rest of the methods are the classical `cleanup` method to free the images and the `getTexture` method to be able to retrieve one already created `Texture` using is file path and through their position.
594594

595595
```java
596596
public class TextureCache {
@@ -833,7 +833,7 @@ public class DescriptorPool {
833833
}
834834
```
835835

836-
The format of each descriptor set must me defined by a descriptor set layout. The layout will be something very dependent on the specific data structures that we will use in our shaders. However, we will create an abstract class to avoid repeating the cleanup method and to store its handle:
836+
The format of each descriptor set must be defined by a descriptor set layout. The layout will be something very dependent on the specific data structures that we will use in our shaders. However, we will create an abstract class to avoid repeating the cleanup method and to store its handle:
837837

838838
```java
839839
package org.vulkanb.eng.graph.vk;
@@ -993,7 +993,7 @@ public class TextureSampler {
993993
In order to create a sampler, we need to invoke the `vkCreateSampler` function which requires a `VkSamplerCreateInfo` structure, defined by the following fields:
994994

995995
- `sType`: The type of the structure: `VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO`.
996-
- `magFilter` and `minFilter`: control how magnification and magnification filter work while performing a texture lookup. In this case, we are using a `VK_FILTER_LINEAR` filter, which is the value for a liner filter (for a 2D texture, it combines for values of four pixels weighted). You can use `VK_FILTER_NEAREST` to pickup just the closest value in the lookup or `VK_FILTER_CUBIC_EXT` to apply cubic filtering (it uses 16 values for 2D textures).
996+
- `magFilter` and `minFilter`: control how magnification and magnification filter work while performing a texture lookup. In this case, we are using a `VK_FILTER_LINEAR` filter, which is the value for a linear filter (for a 2D texture, it combines for values of four pixels weighted). You can use `VK_FILTER_NEAREST` to pickup just the closest value in the lookup or `VK_FILTER_CUBIC_EXT` to apply cubic filtering (it uses 16 values for 2D textures).
997997
- `addressModeU`, `addressModeV` and `addressModeW`: This will control what will be returned for a texture lookup when the coordinates lay out of the texture size. The `U`, `V` and `W` refer to the `x`, `y` and `z` axis (for 3D images). In this case, we specify the `VK_SAMPLER_ADDRESS_MODE_REPEAT` which means that the texture is repeated endlessly over all the axis. There are some other values such as `VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT` or `VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE` which are similar as the ones used in OpenGL.
998998
- `borderColor`: This sets the color for the border that will be used for texture lookups beyond bounds when `VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER` is used in the `addressModeX` attributes.
999999
- `unnormalizedCoordinates`: Texture coordinates cover the [0, 1] range. When this parameter is set to `true` the coordinates will cover the ranges [0, width], [0, height].
@@ -1175,7 +1175,7 @@ public abstract class DescriptorSet {
11751175
...
11761176
}
11771177
```
1178-
The code is similar as the descriptor set used for textures, with the following exception, ee use a `VkDescriptorBufferInfo` to link the descriptor with the buffer that will hold the descriptor set values. Now we can create another class, specifically for uniforms, which extends the `SimpleDescriptorSet` class, named `UniformDescriptorSet`:
1178+
The code is similar as the descriptor set used for textures, with the following exception, we use a `VkDescriptorBufferInfo` to link the descriptor with the buffer that will hold the descriptor set values. Now we can create another class, specifically for uniforms, which extends the `SimpleDescriptorSet` class, named `UniformDescriptorSet`:
11791179
```java
11801180
public abstract class DescriptorSet {
11811181
...

0 commit comments

Comments
 (0)