Skip to content

Commit

Permalink
vk: rt: tune denoiser "a-trous" parameters a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
w23 committed Jan 29, 2024
1 parent 1f8e9fe commit 5d6c1d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion ref/vk/TODO.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
## Next
- [ ] add white furnace render test
- [ ] tune A-Trous step widths for different channels
- [ ] temporal glitches with dontBlurSamples() and ATrous
- [ ] fix no-hit bounce absent legacy blending
- [ ] -vkdbgprintf or something
- [ ] performance profiling and comparison

## 2024-01-29 E370
- [x] bounce > 1 brighness
- [ ] tune A-Trous step widths for different channels
- [x] tune parameters
- [x] "cone width"
- [ ] different parameters/radii for different channels
- [ ] multiple passes

# Previously
## 2024-01-26 E369
Expand Down
6 changes: 3 additions & 3 deletions ref/vk/shaders/denoiser.comp
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,18 @@ Components blurATrous(const ivec2 res, const ivec2 pix, vec3 pos, vec3 shading_n
c.direct_diffuse = c.direct_specular = c.indirect_diffuse = c.indirect_specular = vec3(0.);

const float sn_phi = .5;
const float p_phi = 1.;
const float p_phi = 10.;
const float step_width = 1.;

const ivec2 res_scaled = res / INDIRECT_SCALE;

float weight_total = 0.;
const int offset_scale = 3;
for (int x = -a_trous_width; x <= a_trous_width; ++x) {
const float x_kernel = kATrousKernel[x+a_trous_width];
for (int y = -a_trous_width; y <= a_trous_width; ++y) {
const float y_kernel = kATrousKernel[y+a_trous_width];
const ivec2 offset = ivec2(x, y);
const ivec2 p = pix + offset;
const ivec2 p = pix + ivec2(x, y) * offset_scale;

if (any(greaterThanEqual(p, res)) || any(lessThan(p, ivec2(0)))) {
continue;
Expand Down

0 comments on commit 5d6c1d4

Please sign in to comment.