基于物理的相机值太小

时间:2015-11-17 00:36:12

标签: c++ opengl math camera physics

我目前正在研究基于物理的相机模型,并且发现了这个博客:https://placeholderart.wordpress.com/2014/11/21/implementing-a-physically-based-camera-manual-exposure/ 所以我试着在OpenGL中自己实现它。我想过使用函数getSaturationBasedExposure计算曝光并将该值传递给着色器,在那里我将最终颜色乘以该值:

float getSaturationBasedExposure(float aperture,
                             float shutterSpeed,
                             float iso)
{
    float l_max = (7800.0f / 65.0f) * Sqr(aperture) / (iso * shutterSpeed);
    return 1.0f / l_max;
}



colorOut = color * exposure;

但是我从该函数得到的值太小了(比如大约0.00025等)所以我想我很想知道该函数的返回值。 在博客中提到了一个测试场景,其中场景亮度大约为4000,但我还没有看到一个着色器实现工作的颜色范围从0到4000+(甚至HDR都没那么高,对吧?)。

那么有人能解释我如何正确地将计算应用于OpenGL场景或帮助我理解计算背后的意义吗?

0 个答案:

没有答案
相关问题