playdeadgames / publications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a question

shadercoder opened this issue · comments

hi i have read http://loopit.dk/banding_in_games.pdf article
there is a note mentioned
"GPUs round, so dither-range should be [-1;1["
i didn't know what the rounding operation different from GPU and CPU?
thank you
peter liu

What I mean is that when rendering to a rendertarget, the GPU will round() rather than floor() values when quantizing the shader-float-values to 8bit integer. Since round(x) = floor(x+0.5), we should subtract 0.5 from our [-0.5;1.5[ interval, resulting in a symmetric dither in the interval [-1;1[.

And just to answer you actual question, rounding is identical on CPUs and GPUs.

Hi
already understand it!
thank you