【计算机图形学】体渲染专题 (二)
首先,老规矩:
未经允许禁止转载(防止某些人乱转,转着转着就到蛮牛之类的地方去了)
B站:Heskey0
【Computer Graphics】Photorealistic Rendering of Volume Effect
Heskey0 (Bilibili)
December 2021
Based On Mark Pauly's Thesis[1999] and 《PBRT》
Chapter 1 . Sampling Techniques In Path Tracing
1.1. Inverse CDF (Cumulative Density Function)
There are many techniques for generating random variates from a specified probability distribution such as the normal, exponential, or gamma distribution. However, one technique stands out because of its generality and simplicity: the inverse CDF sampling technique.
The algorithm is as follows:
- Obtain or generate a draw (realization) from the standard uniform distribution
- The draw from the CDF is given by
Example of inverse CDF method:
Let be the probability density function, the cumulative density function of
-
generate a draw from the standard uniform distribution
-
the draw from the PDF is given by
1.2. Uniformly sampling a hemisphere
a uniform distribution means that the density function is a constant, so we know that
hence , ,
Consider sampling first. To do so, we need 's marginal density function :
Now, compute the conditional density for :
Notice that the density function for itself is uniform, then use the inverse CDF sampling technique to sample each of these PDFs in turn
Converting these back to Cartesian coordinates, we get the final sampling formula:
1.3. Sample area light
def sample_area_light(hit_pos, pos_normal):
# sampling inside the light area
x = ti.random() * light_x_range + light_x_min_pos
z = ti.random() * light_z_range + light_z_min_pos
on_light_pos = ti.Vector([x, light_y_pos, z])
return (on_light_pos - hit_pos).normalized()
1.4. Cosine-weighted Sampling
We could use the inverse CDF sampling technique as before, but instead we can use a technique known as Malley’s method to generate these cosine-weighted points.
The algorithm is as follows:
-
sample a unit disk (Concentric Mapping)
-
project up to the unit hemisphere
1.5. Multiple importance sampling
MIS allows us to combine different sampling strategies to produce a single unbiased estimator by weighting each sampling strategy by its probability distribution function.
where are independent random variables drawn from some distribution function pi and is some heuristic for weighting each sampling technique with respect to pdf.
balance heuristic:
power heuristic:
Veach determined empirically that is a good value
本文未经允许禁止转载
作者:Heskey0
B站:https://space.bilibili.com/455965619
邮箱:3495759699@qq.com
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南