首页 > 解决方案 > 不明白learnopengl.com中“pre-filter convolution中出现Bright dots”的解决方法

问题描述

我不明白https://learnopengl.com/PBR/IBL/Specular-IBL中“预过滤卷积中的亮点”的解决方案代码,尤其是 PDF(可能性密度函数)部分。

这是代码

float D   = DistributionGGX(NdotH, roughness);
float pdf = (D * NdotH / (4.0 * HdotV)) + 0.0001; 

float resolution = 512.0; // resolution of source cubemap (per face)
float saTexel  = 4.0 * PI / (6.0 * resolution * resolution);
float saSample = 1.0 / (float(SAMPLE_COUNT) * pdf + 0.0001);

float mipLevel = roughness == 0.0 ? 0.0 : 0.5 * log2(saSample / saTexel); 

我不知道为什么(D * NdotH / (4.0 * HdotV)) + 0.0001会从那里来。以及为什么要这样saTexel计算saSample

标签: mathopengl

解决方案


推荐阅读