-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blue noise #69
Comments
Hello @JustLexxy , The rand() function relies on the BlueNoise texture to produce random numbers between 0.0 and 1.0, whereas the rng() function computes the random numbers (also in the range of 0.0 to 1.0) all on its own. It produces pretty high quality white noise. If you successfully change all of the occurrences of rand() to rng(), you can then go through and comment out any lines dealing with the blue noise texture itself, such as the following line, also located in the PathTracing shader's main() function: In InitCommon.js, you could also get rid of the following lines, in order to avoid loading in the supplied 256x256 RGBA blue noise texture: Pardon me if you already know this but it has been shown over the last 5 years or so that blue noise is preferable to white noise in path tracing. Path tracing requires many random numbers (usually in the 0.0 to 1.0 range) at every step of the way, from camera ray spawning, to sampling the camera lens (for depth of field effects), to material sampling (like diffuse surfaces), to shadow-ray sampling (producing smoother soft shadows). Blue noise beats white noise in almost every category. Not sure why you would want to disable blue noise, but at any rate, what I outlined in the above paragraphs should do the trick. Let me know if you have any more questions or issues compiling. :) |
Thanks for the answer! |
@JustLexxy Our human vision is extremely good at finding visual patterns, which sort of works against us when it comes to random number/ray path generation. If the random number generator is of low quality, we see the effects as blotchy or streaky light and dark patterns in the final image. White noise is truly random, so preventing these unwanted patterns, repetitions, and artifacts is a work of art on its own! Recently, Blue noise (which is built within certain spatial constraints, and has more high frequency than low frequency, which is better at dodging our excellent human pattern-matching skills, ha) has been found to be less distracting and smooth when used to generate random ray directions and randomly sampled light paths. But once again, whenever you introduce any kind of randomness, no matter how well it is generated, you get the noise baggage that comes along with it. Noise reduction in path tracing is an active area of research in both academics and industry (like NVIDIA RTX). I have implemented a very basic denoiser in my project, so I hope that the noise is not too terrible (as it would be with a raw naive path tracer), but there are new AI-trained denoisers being developed these days that do what you mentioned you wanted in an earlier post - they magically remove most or all of the initial noise. But these are highly sophisticated denoisers and most are proprietary, so unfortunately my project is not at that level yet. Hope this helps further clarify the double-edged sword of randomness and noise when it comes to physically-accurate rendering. 🙂 Let me know if you have any other questions or concerns. Best of luck! |
Oh wow that explained a lot, thank you! |
Ah yes I don't really have documentation, but I did try to follow three.js when it was just starting out all those years ago, and instead have numerous small, focused examples that showcase different aspects of the renderer that might be useful to different people. As always, if you are confused by how something works in my project, or ever need any of my examples clarified, please feel free to ask here in this thread if you like. 😊 |
Yeah the examples were life savers |
Oh that would be cool! Feel free to post here. Glad the examples were helpful! |
Hey dog. I was wondering if you're aware of bootstrapping. YTube's statquest w/ josh has great vid.
The idea is u have a small-ish Nr of samps, and pick from those at random. I skipped over important details.
another thing for your ridiculously performant renderer - an importance map (per-frame grayscale rgb delta)
ideas combined, bootstrapping top 20% noisiest pixels would .. well its an interesting ide. Ive been out of the programming game for a while but i do still come up w ideas. Bootstrapping is awesome
…________________________________
From: Erich Loftis ***@***.***>
Sent: Tuesday, July 12, 2022 1:56 PM
To: erichlof/THREE.js-PathTracing-Renderer ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [erichlof/THREE.js-PathTracing-Renderer] Blue noise (Issue #69)
@JustLexxy<https://github.com/JustLexxy>
Ah yes I don't really have documentation, but I did try to follow three.js when it was just starting out all those years ago, and instead have numerous small, focused examples that showcase different aspects of the renderer that might be useful to different people.
As always, if you are confused by how something works in my project, or ever need any of my examples clarified, please feel free to ask here in this thread if you like. 😊
—
Reply to this email directly, view it on GitHub<#69 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AH4374NFE4AYPPKNQPFJZ3TVTXLWXANCNFSM52TX7TTA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Is it possible to remove the blue noise?
I tried modifying a few things to try and remove the blue noise, but it either does nothing or the code doesn't compile. Do you know/have a fix to remove it?
Thanks!
The text was updated successfully, but these errors were encountered: