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
The code is quite similar as the one used for color attachments, but the layout is different: `VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL` to state that is for depth values.
932
+
The code is quite similar as the one used for color attachments, but the layout is different: `VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL` to state that is for depth values. Inthiscase the store operation can be
933
+
`VK_ATTACHMENT_STORE_OP_DONT_CARE` instead of `VK_ATTACHMENT_STORE_OP_STORE` because we do not need to store the results, we just
934
+
need a depth attachment to perform depth tests. Wedo not need to access those results later on.
933
935
934
936
The `createPipeline` needs to be updated to set the push constants range:
Copy file name to clipboardExpand all lines: bookcontents/chapter-11/chapter-11.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,7 +140,7 @@ public class ScnRender {
140
140
```
141
141
142
142
In addition to just having a single `VkRenderingAttachmentInfo.Buffer`, the `imageLayout` is now `VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL` instead of being
143
-
`VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR` since the image is not related yo the swp chain now. The methods `createDepthAttachment` and `createDepthAttachmentInfo` are
143
+
`VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR` since the image is not related yo the swap chain now. The methods `createDepthAttachment` and `createDepthAttachmentInfo` are
Copy file name to clipboardExpand all lines: bookcontents/chapter-16/chapter-16.md
+1-4Lines changed: 1 addition & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -478,10 +478,7 @@ public class ShadowRender {
478
478
}
479
479
```
480
480
481
-
We create the depth attachment in the `createDepthAttachment` information. In this case it will be a single image but with as many layers as cascade shadows will be. We
482
-
will see how this modifies the creation of attachments. The size of the depth image will not be dependant on the screen size, it weill be a configurable value.
483
-
The rest of the methods to crate attachment information, render information and shader and pipeline are quite similar.
484
-
In this case, we are using three shader modules for vertex, geometry and fragment shading.
481
+
We create the depth attachment in the `createDepthAttachment` information. In this case it will be a single image but with as many layers as cascade shadows will be. We will see how this modifies the creation of attachments. The size of the depth image will not be dependant on the screen size, it weill be a configurable value. The rest of the methods to crate attachment information, render information and shader and pipeline are quite similar. In this case, we are using three shader modules for vertex, geometry and fragment shading. In this case, we need to store depth attachment, this is why we use the `VK_ATTACHMENT_STORE_OP_STORE`, because we will sample it while applying lights
485
482
486
483
The `ShadowRender` class defines also a `cleanup` method to free the resources and some getters to retrieve the depth attachment and the cascade shadows.
0 commit comments