GithubHelp home page GithubHelp logo

Comments (10)

droettger avatar droettger commented on July 28, 2024

Does the web link above the dither function answer your question?
https://github.com/nvpro-samples/vk_raytrace/blob/master/shaders/post.frag#L46

from vk_raytrace.

tigrazone avatar tigrazone commented on July 28, 2024

No. I asked about "Remove banding" code, not only about dithering

from vk_raytrace.

mklefrancois avatar mklefrancois commented on July 28, 2024

The dither code is to remove banding. This is more visible with the "Sun & Sky" environment. If Dither is active, those banding are less visible, even in the first frames.
image

from vk_raytrace.

tigrazone avatar tigrazone commented on July 28, 2024

thank you.
if "sun&sky" not used dither is not usable?

from vk_raytrace.

droettger avatar droettger commented on July 28, 2024

The remove banding code is using dithering to make color changes less visible.
The two lines above the dither() are just calculating the necessary noise and quantization arguments for that function.
If you look at the definitions of the pcg3d() function, that is a linear congruential generator which calculates some noise into the uvec3 components, and the uintBitsToFloat() is using that pseudo random value to calculate a float value by directly putting bits into the mantissa of the IEEE 754 32-bit floating point format (1 sign, 8 exponent, 23 mantissa bits).
The hex value 0x3f800000 is float 1.0f and ORing bits into the lower 23 bits will build a random number in the range of [1.0f, 2.0f) and the minus 1.0f shifts it into the range [0.0f, 1.0f) which is usually the required range for random values.

from vk_raytrace.

tigrazone avatar tigrazone commented on July 28, 2024

is this code did not make monte-carlo convergence worse?

from vk_raytrace.

tigrazone avatar tigrazone commented on July 28, 2024

The dither code is to remove banding. This is more visible with the "Sun & Sky" environment. If Dither is active, those banding are less visible, even in the first frames. image

there is no "Dither" checkbox in code
image

from vk_raytrace.

mklefrancois avatar mklefrancois commented on July 28, 2024

from vk_raytrace.

tigrazone avatar tigrazone commented on July 28, 2024

is this code did not make monte-carlo convergence worse?

from vk_raytrace.

mklefrancois avatar mklefrancois commented on July 28, 2024

The dither is integrated into the post-processing stage, where it adjusts colors similar to the tonemapper. However, it should be noted that it operates independently of the Monte-Carlo convergence computation.

from vk_raytrace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.