r/GraphicsProgramming • u/TheNextJohnCarmack • Oct 09 '21
Question Why does this light spread out so strange?
0
Upvotes
4
u/jntesteves Oct 10 '21 edited Oct 10 '21
I really recommend these two resources on color banding and dithering:
YouTube video from GDC Europe 2016: Low Complexity, High Fidelity: The Rendering of INSIDE
Slide deck from Lottes at GDC 2016: GdcVdrLottes.pdf
1
u/immibis Oct 10 '21 edited Jun 13 '23
1


8
u/msqrt Oct 10 '21
You mean the banding? There's only so many color values a monitor can display, and the chunks you're seeing are the distinct pixel values (one of the chunks is (9,9,9), the next is (10,10,10) and so on). The easiest way to deal with this is to add a tiny bit of noise to your result. This essentially dithers the end result so that you can't see the specific bands, but the noise should be perceptually unnoticeable. Something like
vec3(rnd()/256.)should be fine (for a random functionrndthat returns a random value between 0 and 1, you can find a bunch of random noise functions by googling or on shadertoy.)