diff --git a/README.md b/README.md index 2ee3bd2..7911a7a 100644 --- a/README.md +++ b/README.md @@ -248,10 +248,38 @@ A ssao pass to add more realism to the scene. Use temporal accumulation to do de This pass calculates **direct lighting** and integrats it with **indirect and reflection** information that gathered from previous passes. Information needed (material, world position, etc.) for Direct lighting was obtained and uncompressed/reconstructed from G-Buffer, then ray-query features was used to compute shading accordingly. -| Direct Lighting | Indirect Lighting | Reflection | -| :------------------------------------------: | :--------------------------------------------: | :--------------------------------------: | -| ![](./docs/img/lightPass/directlighting.png) | ![](./docs/img/lightPass/indirectLighting.png) | ![](./docs/img/lightPass/reflection.png) | +| Combined | Direct Lighting | Indirect Lighting | Reflection | +| :------------------------------------: | :------------------------------------------: | :--------------------------------------------: | :--------------------------------------: | +| ![](./docs/img/lightPass/combined.png) | ![](./docs/img/lightPass/directlighting.png) | ![](./docs/img/lightPass/indirectLighting.png) | ![](./docs/img/lightPass/reflection.png) | ### TAA Pass +The TAA pass **jitters** the view frustum and strategically **averges** the color between multiple frames. + +Position Reconstruction: Reconstruct world position using depth buffer and screen uv. + +Previous Frame Reprojection: Using the view-projection matrix of last frame to calculate uv of world position of current pixel in last frame. + +| Reprojection | +| :----------------------------------: | +| ![](./docs/img/TAA/reprojection.png) | + +Neighbor Color Vector AABB: Sample the 3x3 neighbor color and adjacent neighbor color (surrounding pixels in "+" pattern), calculate aabb of color vector + +| AABB | +| :----------------------------: | +| ![](./docs/img/TAA/33plus.png) | + +Neighbor Color Clipping: clip the current color towards history color instead of just clamping it. In this way color from previous frame is trivially accepted to reduce ghost and smearing effect. + +| Clamping and Clipping | +| :-------------------------------: | +| ![](./docs/img/TAA/clampclip.png) | + +Blend and weigh history frames: Lerp between colors of past frame and this frame. Higher feedback factor will have a faster converge but will introduce artifacts. + +| Blend | +| :---------------------------: | +| ![](./docs/img/TAA/blend.png) | + ### Tone Mapping Pass diff --git a/docs/img/TAA/33plus.png b/docs/img/TAA/33plus.png new file mode 100644 index 0000000..bcf69d5 Binary files /dev/null and b/docs/img/TAA/33plus.png differ diff --git a/docs/img/TAA/blend.png b/docs/img/TAA/blend.png new file mode 100644 index 0000000..744084a Binary files /dev/null and b/docs/img/TAA/blend.png differ diff --git a/docs/img/TAA/clampclip.png b/docs/img/TAA/clampclip.png new file mode 100644 index 0000000..5a325b3 Binary files /dev/null and b/docs/img/TAA/clampclip.png differ diff --git a/docs/img/TAA/reprojection.png b/docs/img/TAA/reprojection.png new file mode 100644 index 0000000..72b15ce Binary files /dev/null and b/docs/img/TAA/reprojection.png differ diff --git a/docs/img/lightPass/combined.png b/docs/img/lightPass/combined.png new file mode 100644 index 0000000..03d18a6 Binary files /dev/null and b/docs/img/lightPass/combined.png differ diff --git a/src/main.cpp b/src/main.cpp index e4053d1..5aa783a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -61,10 +61,10 @@ int main(int argc, char **argv) InputParser parser(argc, argv); //std::string sceneFile = parser.getString("-f", "Sponza/Sponza.gltf"); - //std::string sceneFile = parser.getString("-f", "Street/scene.gltf"); - std::string sceneFile = parser.getString("-f", "late_night_office.glb"); + std::string sceneFile = parser.getString("-f", "Street/scene.gltf"); + //std::string sceneFile = parser.getString("-f", "late_night_office.glb"); // std::string sceneFile = parser.getString("-f", "Hospital/scene.gltf"); - // std::string sceneFile = parser.getString("-f", "station.glb"); + //std::string sceneFile = parser.getString("-f", "station.glb"); //std::string sceneFile = parser.getString("-f", "station/station_lowRough.glb"); //std::string sceneFile = parser.getString("-f", "apocal/apocal.gltf"); //std::string sceneFile = parser.getString("-f", "Street/scene.gltf"); diff --git a/src/sample_example.cpp b/src/sample_example.cpp index 4006fe5..ed49caa 100644 --- a/src/sample_example.cpp +++ b/src/sample_example.cpp @@ -990,6 +990,25 @@ std::vector SampleExample::hammersleySequence(int maxNumberPoints) std::mt19937 g(rd()); std::shuffle(points.begin(), points.end(), g); + /*std::vector points{ + {0.500000f, 0.333333f}, + {0.250000f, 0.666667f}, + {0.750000f, 0.111111f}, + {0.125000f, 0.444444f}, + {0.625000f, 0.777778f}, + {0.375000f, 0.222222f}, + {0.875000f, 0.555556f}, + {0.062500f, 0.888889f}, + {0.562500f, 0.037037f}, + {0.312500f, 0.370370f}, + {0.812500f, 0.703704f}, + {0.187500f, 0.148148f}, + {0.687500f, 0.481481f}, + {0.437500f, 0.814815f}, + {0.937500f, 0.259259f}, + {0.031250f, 0.592593f} + };*/ + return points; }