Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 371c74a

Browse files
committed
Updated wording.
1 parent 08b7f41 commit 371c74a

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

10_Multisampling.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ VkSampleCountFlagBits msaaSamples = VK_SAMPLE_COUNT_1_BIT;
1515
...
1616
```
1717

18-
Having done that, we now need to determine what is the maximum number of samples supported by the hardware. This information can be extracted from `VkPhysicalDeviceProperties` associated with our selected physical device. We're using a depth buffer, so we have to take into account the sample count for both color and depth - the lower number will be the maximum we can support:
18+
We now need to determine what is the maximum number of samples supported by the hardware. This information can be extracted from `VkPhysicalDeviceProperties` associated with our selected physical device. We're using a depth buffer, so we have to take into account the sample count for both color and depth - the lower number will be the maximum we can support. If the hardware supports only one sample (unlikely on modern graphics cards) the final image will look unchanged.
1919

2020
```c++
2121
VkSampleCountFlagBits getMaxUsableSampleCount() {
@@ -34,7 +34,7 @@ VkSampleCountFlagBits getMaxUsableSampleCount() {
3434
}
3535
```
3636

37-
If the hardware supports only one sample (unlikely on modern graphics cards) the final image will look the same as before. We will now use this function to set the `msaaSamples` variable during physical device selection process. For this, we have to slightly modify the `pickPhysicalDevice` function:
37+
We will now use this function to set the `msaaSamples` variable during physical device selection process. For this, we have to slightly modify the `pickPhysicalDevice` function:
3838

3939
```c++
4040
void pickPhysicalDevice() {
@@ -123,7 +123,7 @@ void transitionImageLayout(VkImage image, VkFormat format, VkImageLayout oldLayo
123123
}
124124
```
125125
126-
Now that we have multisampled color buffer in place it's time to take care of depth. Modify `createDepthResources` and create a multisampled depth buffer:
126+
Now that we have multisampled color buffer in place it's time to take care of depth. Modify `createDepthResources` and add creation steps for a multisampled depth buffer:
127127
128128
```c++
129129
void createDepthResources() {
@@ -135,7 +135,7 @@ void createDepthResources() {
135135
}
136136
```
137137

138-
We whave now creates a couple of new Vulkan resources, so let's not forget to release them when necessary:
138+
We have now creates a couple of new Vulkan resources, so let's not forget to release them when necessary:
139139

140140
```c++
141141
void cleanupSwapChain() {
@@ -150,7 +150,7 @@ void cleanupSwapChain() {
150150
151151
## Using multisampling
152152
153-
With only a few simple steps we created additional buffers and image views necessary for multsampling and also determined how many samples we can use on the hardware we're using - it's now time to put it all together and see the results! We'll take care of the render pass first. Modify `createRenderPass` and update color and depth attachment creation info structs:
153+
With only a few simple steps we created additional buffers and image views necessary for multsampling and also determined how many samples we can use on our hardware - it's now time to put it all together and see the results! Let's take care of the render pass first. Modify `createRenderPass` and update color and depth attachment creation info structs:
154154
155155
```c++
156156
void createRenderPass() {
@@ -162,7 +162,7 @@ void createRenderPass() {
162162
...
163163
```
164164

165-
Apart from the obvious change that tells the attachments to use more samples, you'll notice a change to the `finalLayout` parameter to the color attachment. This is because the multisampled color buffer will be only used to store color pixels now - for presentation, we can only use a single-sampled attachment. This also applies to multisampled depth, which means we need to create additional resolve attachments:
165+
Apart from the obvious change that tells the attachments to use more samples, you'll notice a change to the `finalLayout` parameter for the color attachment. This is because the multisampled color buffer will be only used to store color pixels - for presentation, we can only use a single-sampled attachment. This also applies to multisampled depth, which means we need to create additional resolve attachments:
166166

167167
```c++
168168
...
@@ -237,7 +237,7 @@ Now run your program and you should see the following:
237237

238238
![](/images/multisampling.png)
239239

240-
Just like with mipmapping, the difference may not be apparent straight away when looking at this simple scene. On a closer look you'll notice that the edges on the roof are not as jagged anymore and the whole image seems a bit smoother compared to the original.
240+
Just like with mipmapping, the difference may not be apparent straight away. On a closer look you'll notice that the edges on the roof are not as jagged anymore and the whole image seems a bit smoother compared to the original.
241241

242242
![](/images/multisampling_comparison.png)
243243

0 commit comments

Comments
 (0)