math - 不明白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
。
解决方案
推荐阅读
- php - 如何使用 sql update 更新数据库中的电子邮件?
- c++11 - 向量开始元素上 std::vector::erase 的时间复杂度
- java - 如何在 Java 中读取和接受带有 name/id/title 的自定义 CLI 参数?
- android - 无法滚动从 Android Studio 3.2 中的 Profiler 工具中选择的进程列表
- javascript - 我正在尝试将我的产品列表数量限制为 10
- groovy - 从其他脚本动态导入 groovy 脚本
- java - 二维几何形状顶点坐标检测
- android - 当我的 android 应用程序处于终止模式时如何触发 GA 事件?
- apache-kafka - 如何从kafka中的__consumer_offsets主题中找到消费者主题和组id?
- laravel - Laravel Role HasMany 关系