cmft icon indicating copy to clipboard operation
cmft copied to clipboard

incorrect AABB in determineFilterArea - fix filterSize value

Open plepers opened this issue 10 years ago • 4 comments

Hi,

Radiance filter create some artifact when gloss become low ( ~< 3 ).

aabb_issue

It seem to come from incorrect filterSize and thus incorrect filter areas (aabb). I'm not 100% confident about fix i've done, but, filterAngle is already half the filter cone angle so filterSize should just be :

filterSize = filterAngle / ( texelAngle * facesize )

Moreover, changing filterSizehere can have some side effects I didn't noticed. Maybe we should just double filterSize, locally, in determineFilterAreafunction.

Pierre

plepers avatar Sep 16 '15 09:09 plepers

Could you tell me how to reproduce the error? I would like to have a look at what exactly is causing the problem.

dariomanesku avatar Sep 18 '15 11:09 dariomanesku

Can you check if this happens when you filter only on GPU (--numCpuProcessingThreads 0 --useOpenCL true)?

dariomanesku avatar Sep 20 '15 17:09 dariomanesku

Hi,

I tried both GPU and CPU, they produce different artifacts. Both OK with the fix, but processing time is ~30% longer.


./cmftDebug \
  --numCpuProcessingThreads 0 \
  --useOpenCL true \
  --deviceType gpu \
  --input test1.hdr \
  --filter radiance \
  --glossScale 1 \
  --mipCount 0 \
  --srcFaceSize 256 \
  --dstFaceSize 256 \
  --outputNum 1 \
  --output0 glosstestGPU \
  --output0params hdr,rgbe,latlong

./cmftDebug \
  --deviceType gpu \
  --input test1.hdr \
  --filter radiance \
  --glossScale 1 \
  --mipCount 0 \
  --srcFaceSize 256 \
  --dstFaceSize 256 \
  --outputNum 1 \
  --output0 glosstestCPU \
  --output0params hdr,rgbe,latlong

cmft_artifacts

plepers avatar Sep 22 '15 16:09 plepers

Yup, you're right. Thanks for the report. filterSize is there to speed things up, but it seems that it has a wrong value for small gloss parameters. Using a bigger value for it fixes the problem with the results, but at a performance cost.

I'll have a look over it on first occasion.

dariomanesku avatar Sep 23 '15 23:09 dariomanesku