zpelgrims / lentil

Polynomial optics to Arnold. Camera shader with high-order aberrations, including bidirectional filter that adaptively samples out-of-focus highlights (top level repo)
http://www.lentil.xyz
106 stars 11 forks source link

Fix magic constant in filter_and_add_to_buffer #283

Closed zpelgrims closed 2 years ago

zpelgrims commented 2 years ago

float inv_filter_samples = (1.0 / filter_width_half) / 12.5555; // figure this out so it doesn't break when filter width is not 2

zpelgrims commented 2 years ago

also investigate if this:

if (y < 0 || y >= yres) continue; // edge fix
if (x < 0 || x >= xres) continue; // edge fix

produces the edge brightening around the frame.. the constant above should be different for these samples probably

zpelgrims commented 2 years ago

area of a circle with radius of 2 is 12.57, which is very close to the constant of 12.5555 I matched it to.

is it too close to be a co inky dinky?