Home › Forums › Games202-高质量实时渲染 › 作业资料 & 代码勘误 › Reply To: 作业资料 & 代码勘误
Migo
Participant
你好,想请教一下,作业5的TemporalAccumulation
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
// TODO: Temporal clamp
Float3 color = m_accColor(x, y);
Float3 mean = Float3(0.f), variance = Float3(0.f);
meanVarianceCalc(curFilteredColor, x, y, kernelRadius, mean, variance);
color = Clamp(color, mean-variance*m_colorBoxK, mean+variance*m_colorBoxK);
// TODO: Exponential moving average
float alpha = m_valid(x, y) ? m_alpha : 1.0f;
m_misc(x, y) = Lerp(color, curFilteredColor(x, y), alpha);
}
}
std::swap(m_misc, m_accColor);
这样做的思路有问题吗?为什么我的出来的最终效果比参考要模糊得多的?