games101 Lecture16 Ray Tracing3笔记

lec16

目录

1 概率论复习

2 蒙特卡洛积分Monte Carlo Integration

3  蒙特卡洛路径追踪Path Tracing

3.1 Whitted-Style Ray Tracing存在的问题

3.2 Path Tracing —— 利用蒙特卡洛方法解渲染方程

4 Path Tracing 结语


原文链接:https://blog.csdn.net/Motarookie/article/details/122353183


1 概率论复习


2 蒙特卡洛积分Monte Carlo Integration

3  蒙特卡洛路径追踪Path Tracing

3.1 Whitted-Style Ray Tracing存在的问题

到此我们可以得出,Whitted-Style光追是“错”的,渲染方程是对的。

3.2 Path Tracing —— 利用蒙特卡洛方法解渲染方程

Shade(p,wo)
{
	// 1、来自光源的贡
	对光源均匀采样,即随机选择光源表面一个点x';  //pdf_light = 1 / A
	shoot a ray form p to x';
	L_dir = 0.0;	
	if (the ray is not blocked in the middle)	// 判断是否被遮挡
	L_dir = L_i * f_r * cosθ * cosθ' / |x' - p|^2 / pdf_light;
	//2、来自其他物体的反射光
	L_indir = 0.0;
	Test Russian Roulette with probability P_RR;
	Uniformly sample the hemisphere toward wi;  //pdf_hemi = 1 / 2π
	Trace a ray r(p,wi);
	if (ray r hit a non-emitting object at q)
	    L_indir = shade(q, -wi) * f_r * cosθ / pdf_hemi / P_RR; 
    return L_dir + L_indir;
}

路径追踪不好做点光源的计算,建议把点光源做成有很小面积的面光源。

4 Path Tracing 结语

  • 路径追踪的学习确实比较难。涉及到物理、概率论、微积分、编码
  • 路径追踪是现代正在使用的前沿技术
  • 路径追踪几乎是100%正确的算法

原文链接:https://blog.csdn.net/Motarookie/article/details/122353183

  • 7
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值