Open koiava opened 5 years ago
@koiava
Yes the ghosting (or motion blur) is an artifact of the dynamic demos, where the sample count does not accumulate, but rather keeps sampling a new image every frame. It is a trade-off between distracting motion-blur and distracting noise or grainy objects. You can easily switch the motion blur off on all demos by locating the main function of the shader and adjusting the ratio of the old image to the new image.
main function weights
Just make sure the ratios all add up to 1. For example, most of the demos have an even weight assigned to the old image (0.5) and the new image (0.5). I have tried a lot of different weighting, and I prefer for the dynamic demos, a higher weight given to the old image, say 0.8 and therefore the new image gets 0.2, because they have to add up to 1. The most tricky situation is the Game Engine path tracer, which has static And dynamic objects mixed together. This one I settled on slightly more motion blur or ghosting, rather than have the distracting dark noise on everything like an old TV set that's out of signal. This is a W.I.P. and if I find a better solution, these weights are subject to change in the future.
What further compounds this issue is bright lights. Whether viewing them on the first ray bounce, or in a reflection, bounce 2, these bright objects ghost the most, leaving a trail. I am experimenting with reducing this artifact, as I agree with you and find that instance more distracting than it needs to be.
If you look on YouTube at the old Brigade path tracer, version 1.0, you will see the same trade-offs being made. They also struggled with how much ghosting vs. noise to assign. By Brigade 3.0, they were using multiple (2 to 4) high-end GPUs, overclocking the frame rate with CUDA (120+ fps - something I can't do with WebGL which is capped at 60 fps on the browser) and therefore could achieve more accumulated samples per frame and navigate around this issue.
Hi there. First of all I want to say that I like your demos a lot :) Blending frames directly to old one will always have ghosting and adjusting one global weights will not help. Did you tried temporal reprojection? It should reduce ghosting introduced by camera motion. This is very interesting: https://cg.ivd.kit.edu/atf.php
Hi @koiava Thank you for the link! I was not aware of that paper. I have not tried temporal reprojection yet. I believe Nvidia is addressing this noise vs. ghosting issue with deep-learning noise filters. I'm not sure how all that works either at a higher level or low-level shader code. But it looks like your link has some source code, so hopefully I will be able to get something from it. Thanks again, I will check out the link! :)
I believe that was used for recent path traced quake 2. http://brechpunkt.de/q2vkpt/ Problem here is that you should very probably split rendering integrals in 2 parts at least: Visibility and lighting. Recent talks from NVidia suggests to split lighting into different buffers and denoise them separately. They have optimized denoisers for different types of lights and it works better than end-to-end solution (AI denoiser).
@koiava Ah yes I had seen people playing that version of Quake 2 on YouTube but I didn't know it was open source on GitHub. Thanks for the link and info! I'll enjoy looking through that tech info on their website and the source code. That is one of my goals - to get all this into a playable game engine for simple 3D games.
Path traced gaming is a future. There is no way around :) Here is my attempt : https://www.youtube.com/watch?v=oktNku6gFkM :)
@koiava That's awesome! I somehow missed that one on Shadertoy - I usually check for new shaders a couple of times a week. That's impressive that you were able to get all the physics happening on a GPU shader. I also have some ideas for simple games that can use the path tracing engine. Just have to find some extra time! ;-D
I'm not sure if this was done for a purpose of it's just not working but it's very distracting while navigating. It's in all demos.