Skip to content

Commit 6790a68

Browse files
committed
TAA filtering almost done. VXGI bug fixed and G-Buffer packed
1 parent cf17aa2 commit 6790a68

37 files changed

+625
-347
lines changed

examples/rotating-kabuto/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int main() {
3232
window->init();
3333

3434
Systems::RendererSettings settings{};
35-
settings.samplesMSAA = MSAASamples::x1;
35+
settings.samplesMSAA = MSAASamples::x4;
3636
settings.clearColor = Vec4(0.0, 0.0, 0.0, 1.0);
3737

3838
Systems::BaseRenderer* renderer =
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
This file is part of Vulkan-Engine, a simple to use Vulkan based 3D library
3+
4+
MIT License
5+
6+
Copyright (c) 2023 Antonio Espinosa Garcia
7+
8+
*/
9+
#ifndef TAA_PASS_H
10+
#define TAA_PASS_H
11+
#include <engine/core/passes/postprocess_pass.h>
12+
13+
VULKAN_ENGINE_NAMESPACE_BEGIN
14+
15+
namespace Core {
16+
17+
/*
18+
Tempopral Filtering Pass.
19+
*/
20+
class TAAPass final : public PostProcessPass<2, 0>
21+
{
22+
public:
23+
/*
24+
25+
Input Attachments:
26+
-
27+
- Color
28+
- Velocity Buffer
29+
30+
Output Attachments:
31+
-
32+
- Filtered Color
33+
- Prev Filtered Color
34+
35+
*/
36+
TAAPass(Graphics::Device* device,
37+
const PassLinkage<2, 0>& linkage,
38+
Extent2D extent,
39+
ColorFormatType colorFormat,
40+
bool isDefault = true)
41+
: PostProcessPass(device,
42+
linkage,
43+
extent,
44+
colorFormat,
45+
ENGINE_RESOURCES_PATH "shaders/aa/taa.glsl",
46+
"TAA",
47+
isDefault) {
48+
m_interAttachments.resize(1); //Prev Frame
49+
}
50+
51+
void setup_out_attachments(std::vector<Graphics::AttachmentConfig>& attachments,
52+
std::vector<Graphics::SubPassDependency>& dependencies) override;
53+
54+
void setup_uniforms(std::vector<Graphics::Frame>& frames) override;
55+
56+
void create_framebuffer() override;
57+
58+
void link_input_attachments() override;
59+
60+
void execute(Graphics::Frame& currentFrame, Scene* const scene, uint32_t presentImageIndex = 0) override;
61+
};
62+
63+
} // namespace Core
64+
VULKAN_ENGINE_NAMESPACE_END
65+
66+
#endif

include/engine/core/passes/bloom_pass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ both X and Y axes.
2929
A (first downsampled image).
3030
- Finally, we mix the overall bloom contribution into the HDR source image, with a strong bias towards the HDR source.
3131
*/
32-
class BloomPass : public BaseGraphicPass
32+
class BloomPass final : public BaseGraphicPass
3333
{
3434
protected:
3535
ColorFormatType m_colorFormat = SRGBA_16F;

include/engine/core/passes/composition_pass.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct VXGI { // Settings for Voxel Based GI
4747
uint32_t updateMode = 0;
4848
};
4949

50-
class CompositionPass : public BaseGraphicPass
50+
class CompositionPass final : public BaseGraphicPass
5151
{
5252
/*Setup*/
5353
ColorFormatType m_colorFormat;
@@ -59,8 +59,6 @@ class CompositionPass : public BaseGraphicPass
5959
};
6060
std::vector<FrameDescriptors> m_descriptors;
6161

62-
Graphics::Image m_prevFrame;
63-
6462
struct Settings {
6563
OutputBuffer outputBuffer = OutputBuffer::LIGHTING;
6664
int enableAO = 1;
@@ -70,8 +68,6 @@ class CompositionPass : public BaseGraphicPass
7068
};
7169
Settings m_settings = {};
7270

73-
void create_prev_frame_image();
74-
7571
public:
7672
/*
7773
Input Attachments:
@@ -138,9 +134,6 @@ class CompositionPass : public BaseGraphicPass
138134

139135
void update_uniforms(uint32_t frameIndex, Scene* const scene) override;
140136

141-
void resize_attachments() override;
142-
143-
void cleanup() override;
144137
};
145138
} // namespace Core
146139
VULKAN_ENGINE_NAMESPACE_END

include/engine/core/passes/enviroment_pass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This pass does three things:
2121
- Performs a second renderpass to compute the diuffuse irradiance cubemap.
2222
- Performs a third renderpass to compute the specular irradiance cubemap.
2323
*/
24-
class EnviromentPass : public BaseGraphicPass
24+
class EnviromentPass final : public BaseGraphicPass
2525
{
2626
ColorFormatType m_format;
2727
Graphics::DescriptorSet m_envDescriptorSet;

include/engine/core/passes/forward_pass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Core {
2020
/*
2121
STANDARD FORWARD LIGHTING PASS
2222
*/
23-
class ForwardPass : public BaseGraphicPass
23+
class ForwardPass final : public BaseGraphicPass
2424
{
2525
/*Setup*/
2626
ColorFormatType m_colorFormat;

include/engine/core/passes/geometry_pass.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Core {
1818
/*
1919
DEFERRED RENDERING GEOMETRY PASS
2020
*/
21-
class GeometryPass : public BaseGraphicPass
21+
class GeometryPass final : public BaseGraphicPass
2222
{
2323
/*Setup*/
2424
ColorFormatType m_colorFormat;
@@ -43,10 +43,10 @@ class GeometryPass : public BaseGraphicPass
4343
4444
Output Attachments:
4545
-
46-
- Normal + VelX buffer
46+
- Normal buffer
4747
- Albedo buffer
4848
- Material buffer
49-
- Emmissive + VelY buffer
49+
- Velocity + Emissive buffer
5050
- Depth buffer
5151
*/
5252
GeometryPass(Graphics::Device* device,

include/engine/core/passes/gui_pass.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ attachment. As it is designed to be at the last step of the pipeline.
2020
2121
This pass takes the default pass image (swapchain image)
2222
*/
23-
class GUIPass : public BaseGraphicPass
23+
class GUIPass final : public BaseGraphicPass
2424
{
2525

2626
public:
2727
GUIPass(Graphics::Device* device, VkExtent2D extent)
2828
: BaseGraphicPass(device, extent, 1, 1, true, true, "GUI") {
2929
}
3030

31-
virtual void setup_uniforms(std::vector<Graphics::Frame>& frames) override {
31+
void setup_uniforms(std::vector<Graphics::Frame>& frames) override {
3232
}
33-
virtual void setup_shader_passes() override {
33+
void setup_shader_passes() override {
3434
}
3535

3636
void setup_out_attachments(std::vector<Graphics::AttachmentConfig>& attachments,

include/engine/core/passes/postprocess_pass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void PostProcessPass<numberIN, numberOUT>::setup_out_attachments(
6464
1,
6565
this->m_isDefault ? LAYOUT_PRESENT : LAYOUT_SHADER_READ_ONLY_OPTIMAL,
6666
LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
67-
this->m_isDefault ? IMAGE_USAGE_TRANSIENT_ATTACHMENT | IMAGE_USAGE_COLOR_ATTACHMENT
67+
this->m_isDefault ? IMAGE_USAGE_TRANSIENT_ATTACHMENT | IMAGE_USAGE_COLOR_ATTACHMENT
6868
: IMAGE_USAGE_COLOR_ATTACHMENT | IMAGE_USAGE_SAMPLED,
6969
COLOR_ATTACHMENT,
7070
ASPECT_COLOR,

include/engine/core/passes/precomposition_pass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Pre-composition pass called before the Composition (Lighting) pass in a deferred
3636
SSAO and other lighting effects, such as blurring raytraced shadows by bilinear filering them, in order to be used in
3737
future lighting passes.
3838
*/
39-
class PreCompositionPass : public BaseGraphicPass
39+
class PreCompositionPass final : public BaseGraphicPass
4040
{
4141
/*Descriptors*/
4242
struct FrameDescriptors {

0 commit comments

Comments
 (0)