fix bokeh fx artifacts

This commit is contained in:
shun-iwasawa 2022-09-01 02:41:28 +09:00 committed by manongjohn
parent 2123ba0241
commit a46faab818
3 changed files with 17 additions and 14 deletions

View file

@ -1280,21 +1280,25 @@ void BokehUtils::setOutputRaster(double4* src, const RASTER dstRas,
outPix->r =
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
? (double)PIXEL::maxChannelValue
: (val < 0.) ? 0.
: val);
val = (*src_p).y * (double)PIXEL::maxChannelValue + 0.5;
outPix->g =
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
? (double)PIXEL::maxChannelValue
: (val < 0.) ? 0.
: val);
val = (*src_p).z * (double)PIXEL::maxChannelValue + 0.5;
outPix->b =
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
? (double)PIXEL::maxChannelValue
: (val < 0.) ? 0.
: val);
val = (*src_p).w * (double)PIXEL::maxChannelValue + 0.5;
outPix->m =
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
? (double)PIXEL::maxChannelValue
: (val < 0.) ? 0.
: val);
}
src_p += margin.x;

View file

@ -164,8 +164,7 @@ void Iwa_BokehFx::doCompute(TTile& tile, double frame,
for (auto index : sourceIndices) {
LayerValue layerValue;
layerValue.sourceTile = sourceTiles[index];
layerValue.premultiply =
m_layerParams[index].m_premultiply->getValue() ? 1 : 0;
layerValue.premultiply = m_layerParams[index].m_premultiply->getValue();
layerValue.layerHardness = masterHardness;
layerValue.depth_ref = 0;
layerValue.irisSize = irisSizes.value(index);

View file

@ -212,7 +212,7 @@ void Iwa_BokehRefFx::doCompute(TTile& tile, double frame,
}
ctrls[1] = depth_buff;
layerValue.premultiply = 2; // auto
layerValue.premultiply = false;
layerValue.layerHardness = m_hardness->getValue(frame);
layerValue.depth_ref = 1;
layerValue.distance = 0.5;