gameknife / gkNextRenderer

A Modern gkRenderer
15 stars 2 forks source link

Why "Temporal frames" is too high value? #1

Closed tigrazone closed 1 day ago

tigrazone commented 2 weeks ago

Hello. I'm impressed by you work. But I have question. How to make "Temporal frames" value smaller without visible active noise? When I set 16 -32 I see unstoppable noise. Can it be fixed? Thank you

gameknife commented 2 weeks ago

Good question, right, 16-32 will be an acceptable temporal frames for realtime game, and that is my TARGET. now I just implement a reproject pass to accumlate samples from previous frame, lack of a another denoise pass.

now I'm doing some researching job to fix it.

Appreciate your opinion!

gameknife commented 2 weeks ago

I introduce open image denoiser to RayTracing Renderer, with gpu local memory sharing, it will be merge to dev later. set temporal to 8-16 seems a acceptable result, on my rtx3080, it can archive 100fps@1080p in scene #0

tigrazone commented 2 weeks ago

Oh. I dont pike denoisers and prefer simple path tracer

tigrazone commented 2 weeks ago

Is it real to tune up your reproject to remove noise without denoisers? Maybe off reproject task after N frames and use path tracing only?

gameknife commented 2 weeks ago

the open image denoiser is integrated, rebuild from build_windows_oidn.bat, which set WITH_OIDN=1 to cmake, will open denoiser, the render result is perfect at 16-32 temporal frames.

gameknife commented 1 week ago

this fix fix a huge bug of reproject. no ghosting if sample exists. scene0 with --samples=4 --temporal=32 get great realtime results

tigrazone commented 1 week ago

ok. I will check

tigrazone commented 1 week ago

looks great. thank you!!!

gameknife commented 1 week ago

@tigrazone hi, I just merge a adaptive samples feature to dev, the result looks perfect!

previously, if miss fetch history, we catchup with a 16 sample ( change to sample * 4 recently ) in one frame, that makes some noise in the miss area.

now, I introduce a adaptive buffer, when missing, I will store a Temporal / 4 count to the buffer, it will decrease every frame, and if it greater than 1, we always catch up with sample * 4 every frame. so the miss area will catchup within Temporal / 4 frame.

the result is perfect!

tigrazone commented 1 week ago

Thanks for info. I plan to test it in 2-3 days. Now i'm busy by main work

tigrazone commented 1 week ago

Good idea and result is good. Take a look to really adaptive sampling. https://github.com/berkus/grayzer/blob/work/src/render/ADRender.cpp Your approach dont analize pixels info changes

tigrazone commented 1 week ago

i used this idea from link and have interesting results http://moo.ho.ua/aaa.html look at "uniform" and "distributed". I used for my experiments SmallVCM on CPU in 2019. "from 3 to 6 samples per pixel" is minimal and maximal adaptive samples. i.e. 3 is MUST and maximum is 6. usually 4 or 5 Also I checked difference with neightbor pixels - 1 left, right, up, down

gameknife commented 1 week ago

Good idea and result is good. Take a look to really adaptive sampling. https://github.com/berkus/grayzer/blob/work/src/render/ADRender.cpp Your approach dont analize pixels info changes

Good idea and result is good. Take a look to really adaptive sampling. https://github.com/berkus/grayzer/blob/work/src/render/ADRender.cpp Your approach dont analize pixels info changes

Good idea and result is good. Take a look to really adaptive sampling. https://github.com/berkus/grayzer/blob/work/src/render/ADRender.cpp Your approach dont analize pixels info changes

Thanks, it will helps, currently, I only judge pixel by "object instanced id & material id", so specular or reflection detail will accumulate in-correct, I will ref this implement.

tigrazone commented 1 week ago

from 1 sample per pixel switch to 16 samples for pixel is too much. from 1 samples to 4 like I do is ok. dont do oversampling. be smart, not bruteforce

tigrazone commented 1 week ago

maybe it can be useful for you https://www.iliyan.com/publications/ResidualPathIntegral "code (coming)" on one of author's page https://bingxu.tech/

tigrazone commented 1 week ago

I have an idea how not to tweak variance paramerter. find variance of neightbor pixels and compare chenges of variance avg = sum of variances of neightbor pixels / pixels current variance difference is a peak value of current/avg from 0 to 1 - and this value can be tweaked in UI 0.1 - 0.4 is enough to start adaptive sampling

gameknife commented 1 week ago

I have an idea how not to tweak variance paramerter. find variance of neightbor pixels and compare cheanges of variance avg = sum of variances of neightbor pixels / pixels current variance difference is a peak value of current/avg from 0 to 1 - and this value can be tweaked in UI 0.1 - 0.4 is enough to start adaptive sampling

try it tonight~