Skip to content

Commit

Permalink
update taa readme
Browse files Browse the repository at this point in the history
  • Loading branch information
JinxiangW committed Dec 9, 2024
1 parent 1d90572 commit 88117b3
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 6 deletions.
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file added docs/img/TAA/33plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/TAA/blend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/TAA/clampclip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/TAA/reprojection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/lightPass/combined.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
19 changes: 19 additions & 0 deletions src/sample_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,25 @@ std::vector<vec2> SampleExample::hammersleySequence(int maxNumberPoints)
std::mt19937 g(rd());
std::shuffle(points.begin(), points.end(), g);

/*std::vector<vec2> 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;
}

Expand Down

0 comments on commit 88117b3

Please sign in to comment.