没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
内容概要:本文档详细介绍了《ECSE 446/546:Realistic/Advanced Image Synthesis》课程第四个作业的内容,主要任务是在 Taichi 渲染器中实现隐式和显式路径追踪算法。此外,还需要加入俄罗斯轮盘赌(Russian Roulette)终止方法来减少偏差以及实现折射效果和支持全反射。文中还提供了提交政策、延期政策和学术诚信相关的重要信息。 适合人群:本课程的学生,尤其是对图像渲染有研究兴趣的学习者。 使用场景及目标:帮助学生掌握路径追踪的基本理论及其在实际渲染中的具体实现方法。通过完成这项作业,学员能够更好地理解和应用蒙特卡罗估计、递归全局光照计算和光学原理。 阅读建议:在实践中结合理论讲解进行操作,特别关注各部分之间的相互关系。遇到难点时及时查阅课程提供的资料和技术文档。 -可实现的-有问题请联系博主,博主会第一时间回复!!!
资源推荐
资源详情
资源评论
Contents
1! Assignment Policies
!!1.1! Assignment Submission
!!1.2! Late policy
!!1.3! Collaboration & Plagiarism
2! Implicit Path Tracing
3! Explicit Path Tracing
4! Russian Roulette
5! Caustics
6! You're Done"
ECSE 446/546: Realistic/Advanced Image Synthesis
Assignment 4: Path Tracing
Due: Thursday, December 12
th
, 2024 at 11:59pm EST on myCourses
Final weight: 30%
1 Assignment Policies
As with previous assignments, this one builds on top your previous code bases.
1.1 Assignment Submission
Gather all the python source files within the taichi_tracer/ folder (i.e., everything except the scene_data_dir/
folder) and compress them into a single zip file. Name your zip file according to your student ID, as:
YourStudentID.zip
For example, if your ID is 234567890, your submission filename should be 234567890.zip.
DO NOT ADD ANYTHING BEFORE OR AFTER THE MCGILL ID.
In accordance with article 15 of the Charter of Students' Rights, students may submit any written or programming
components in either French or English.
1.2 Late policy
All the assignments are to completed individually. You are expected to respect the late day policy and
collaboration/plagiarism polices, discussed below.
If you require an accomodation, please advise McGill Student Accessibility and Achievement (514-398-6009) as
early in the semester as possible. In the event of circumstances beyond our control, the evaluation scheme as
detailed on the course website and on assignment handouts may require modification.
1.3 Collaboration & Plagiarism
Plagiarism is an academic offense of misrepresenting authorship. This can result in penalties up to expulsion. It is
also possible to plagiarise your own work, e.g., by submitting work from another course without proper attribution.
When in doubt, attribute!
You are expected to submit your own work. Assignments are individual tasks. This does not need to preclude forming
an environment where you can be comfortable discussing ideas with your classmates. When in doubt, some good
rules to follow include:
fully understand every step of every solution you submit,
only submit solution code that was written (not copy/pasted/modified, not ChatGPT'ed, etc.) by you, and
never refer to another student's code — if at all possible, we recommend that you avoid looking at another
classmates code.
McGill values academic integrity and students should take the time to fully understand the meaning and
consequences of cheating, plagiarism and other academic offenses (as defined in the Code of Student Conduct and
Disciplinary Procedures — see these two links).
Additional policies governing academic issues which affect students can be found in the Handbook on Student
Rights and Responsibilities.
2 Implicit Path Tracing
You will implement a 1-sample/path MC estimator of the (recursive) global illumination equation:
as
where the will be drawn using BRDF importance sampling, i.e., .
In the implicit path tracing scenario (with biased maximum path length), the incremental path construction
terminates under only a few conditions:
1. lies on a light source, yielding a (non-recursive, deterministic) value for
,
2. exits the scene (i.e., does not intersect any object), or
3. you have reached the maximum num_bounces path length limit before hitting a light.
SPP SPP
SPP
1
bounce
2
bounce
3
bounce
4
bounce
3 Explicit Path Tracing
You will next implement an explicit path tracer, separating out the direct (non-recursive) and indirect (recursive)
lighting contributions as:
where the (non-recursive) direct illumination contribution will be computed using light importance
sampling, and the (recursive) indirect term is computed using BRDF importance sampling. Here,
unlike the implicit case above, recursive path vertices should be rejected if they contribute (locally, i.e., at the current
path vertex) to “direct illumination”, adding a certain complexity to the algorithmic logic; this is denoted
mathematically, in part, by the exclusion of points on the light from the integration domain of the recursive
indirect contribution, i.e., where .
Validation against the implicit path tracing results can be used to confirm that the explicit path tracer converges to
the same result (albeit, usually, with far fewer accumulated samples per pixel). As discussed in class, recall that —
unlike the implicit case — each 1-sample estimate that your Scene.render explicit path tracer generates may
potentially correspond to a contribution from more than one energy carrying light path.
In the explicit path tracing scenario (with biased maximum path length), the incremental path construction
terminates under only a few conditions:
1. lies on a light source, terminating the path to avoid double counting direct illumination,
2. exits the scene (i.e., does not intersect any object), or
3. you have reached the maximum num_bounces path length limit before hitting a light.
SPP SPP
SPP
1
bounce
2
bounce
3
bounce
4
bounce
4 Russian Roulette
Terminating a path based on a fixed number of bounces — as we have prescribed thus far — introduces bias.
Russian roulette is an unbiased, probabilistic termination method that relies on a user-defined termination
probability .
At every bounce in your explicit path tracer, you will evaluate the direct illumination contribution as usual, however —
before continuing on with the recursive indirect contribution, you will using Russian roulette to decide whether to
continue the path: first, draw a uniform variable and then, if , you terminate the recursion —
returning a 0 value for the (remaining recursive) indirect contribution at the current path vertex; otherwise, you
continue the recursive process and adjust the remaining recursive indirect illumination estimate according to Russian
roulette termination probability , as:
In explicit path tracing with Russian roulette (still retaining a biased maximum path length, strictly for comparison
purposes with earlier implementations), the incremental path construction terminates under only a few conditions:
1. the recursive ray lies on a light source, terminating the path to avoid double counting direct
illumination,
2. exits the scene (i.e., does not intersect any object),
3. you have reached the maximum num_bounces path length limit before hitting a light, or
4. your path is terminated by the Russian roulette process, i.e., when .
100
SPP
2
bounce
3
bounce
4
bounce
ECSE 546 Students Only
5 Caustics
Refractions
ECSE 546 students will implement (perfectly specular) refraction scattering events, following Snell's law: concretely,
Snell's law states that — given a surface interface between media with differing indices of refraction, and
(Material.Ni in our codebase) — an ray with incident angle will be refracted into (or out “from”) the interface at
an angle of refraction prescribed by the following relationship:
and so . During refraction, we need to ensure that , otherwise Total Internal
Reflection (TIR) occurs; in these configurations, we will treat the (recursive) TIR reflection event, as described below.
First however, assuming we are not in a TIR setting, the refracted ray direction is defined as:
If there is TIR however, the ray cannot refract across the interface and, instead, has to reflect about the normal at an
angle (i.e., perfect specular reflection).
SPP SPP
SPP
1
bounce
2
bounce
3
bounce
4
bounce
6 You're Done!
Congratulations, you've completed the 4
th
and final assignment. Review the submission procedures and guidelines
at the start of this handout before submitting your assignment solution.
formatted by Markdeep!1.17!!
Every time you submit a new file on myCourses, your previous submission will be overwritten. We will only
grade the final submitted file, so feel free to submit often as you progress through the assignment.
ⓘ
Late Day Allotment and Late Policy
Every student will be allowed a total of six (6) late days during the entire semester, without penalty.
Specifically, failure to submit a (valid) assignment on time will result in a late day (rounded up to the
nearest day) being deducted from the student's late day allotment. Once the late day allotment is
exhausted, any further late submissions will obtain a score of 0%. Exceptional circumstances will be
treated as per McGill's Policies on Student Rights and Responsibilities.
☒
Computational plagiarism detection tools are employed as part of the evaluation procedure in ECSE
446/546. Students may only be notified of potential infractions at the end of the semester.
☑
𝐿(𝐱, ) = (𝐱, ) + 𝐿(ray(𝐱, ), ) (𝐱, , ) max(𝐧 ⋅ , 0)𝑑 ,
𝜔
𝑜
𝐿
𝑒
𝜔
𝑜
∫
𝑆
2
𝜔
𝑖
𝜔
𝑖
𝑓
𝑟
𝜔
𝑜
𝜔
𝑖
𝜔
𝑖
𝜔
𝑖
𝐿(𝐱, ) ≈ (𝐱, ) + ,
𝜔
𝑜
𝐿
𝑒
𝜔
𝑜
𝐿(ray(𝐱, ), ) (𝐱, , ) max(𝐧 ⋅ , 0)
𝜔
𝑗
𝜔
𝑗
𝑓
𝑟
𝜔
𝑜
𝜔
𝑗
𝜔
𝑗
𝑝( )
𝜔
𝑗
𝜔
𝑗
∼ 𝑝(𝜔) ∝ (𝐱, , 𝜔)
𝜔
𝑗
𝑓
𝑟
𝜔
𝑜
ray(𝐱, ) = 𝐲
𝜔
𝑗
𝐿(ray(𝐱, ), ) = (𝐲, − )
𝜔
𝑗
𝜔
𝑗
𝐿
𝑒
𝜔
𝑗
ray(𝐱, )
𝜔
𝑗
1 10
10
2
A common design pattern in implicit path tracing implementations is to incrementally update the path
throughput, starting with an initial value of and updating according to throughput *=
; then, upon termination, the final 1-sample/path estimate is
set as either L = throughput * or zero (e.g., when the recursive ray does not hit an emitter).
ⓘ
(1, 1, 1)
(
(𝐱, − , ) max(𝐧 ⋅ , 0)
)
/
𝑝( )
𝑓
𝑟
𝜔
𝑗−1
𝜔
𝑗
𝜔
𝑗
𝜔
𝑗
(𝐲, − )
𝐿
𝑒
𝜔
𝑗
Deliverable 1 [30 points]
Complete the implementation of your A4Renderer's render() function to support the implicit path
tracing algorithm, as described above.
☑
𝐿(𝐱, ) = (𝐱, ) + (𝐱, ) + ,
𝜔
𝑜
𝐿
𝑒
𝜔
𝑜
𝐿
𝑑𝑖𝑟𝑒𝑐𝑡
𝜔
𝑜
𝐿(ray(𝐱, ), ) (𝐱, , ) max(𝐧 ⋅ , 0)𝑑
∫
∩
𝑆
2
𝑒
𝜔
𝑖
𝜔
𝑖
𝑓
𝑟
𝜔
𝑜
𝜔
𝑖
𝜔
𝑖
𝜔
𝑖
(𝐱, )
𝐿
𝑖𝑛𝑑𝑖𝑟𝑒𝑐𝑡
𝜔
𝑜
(𝐱, )
𝐿
𝑑𝑖𝑟𝑒𝑐𝑡
𝜔
𝑜
(𝐱, )
𝐿
𝑖𝑛𝑑𝑖𝑟𝑒𝑐𝑡
𝜔
𝑜
𝐲 ∈
𝑒
𝐿(ray(𝐱, ), ) = (𝐲, − ) ≠ 0
𝜔
𝑖
𝜔
𝑖
𝐿
𝑒
𝜔
𝑖
ray(𝐱, ) = 𝐲
𝜔
𝑗
ray(𝐱, )
𝜔
𝑗
1 10
10
2
Deliverable 2 [10 points]
Complete the implementation of your A4Renderer's render() function to support the explicit path
tracing algorithm, as described above.
☑
𝑞
𝜉 ∼ 𝑈[0, 1] 𝜉 < 𝑞
𝑞
𝐿( , ) = ( , ) + ( , ) + ,
𝐱
′
𝜔
𝑜
𝐿
𝑒
𝐱
′
𝜔
𝑜
𝐿
𝑑𝑖𝑟𝑒𝑐𝑡
𝐱
′
𝜔
𝑜
( , )
𝐿
𝑖𝑛𝑑𝑖𝑟𝑒𝑐𝑡
𝐱
′
𝜔
𝑜
1 − 𝑞
ray( , ) = 𝐲
𝐱
′
𝜔
𝑗
ray(𝐱, )
𝜔
𝑗
𝜉 < 𝑞
𝑞 = 0.2 𝑞 = 0.4 𝑞 = 0.6 𝑞 = 0.8
Deliverable 3 [5 points]
Modify your implementation of A4Renderer's render() to implement an explicit path tracer with
support Russian roulette, as described above.
☑
𝜂
1
𝜂
2
𝜃
𝑜
𝜃
𝑡
sin = sin ,
𝜂
1
𝜃
𝑜
𝜂
2
𝜃
𝑡
sin = sin
𝜃
𝑡
𝜂
1
𝜂
2
𝜃
𝑜
0 ≤ sin ≤ 1
𝜃
𝑡
𝐭
𝐭 = − +
(
cos −
)
𝐧.
𝜂
1
𝜂
2
𝜔
𝐨
𝜂
1
𝜂
2
𝜃
𝑜
1 −
sin
2
𝜃
𝑡
‾ ‾‾‾‾‾‾‾‾‾
√
=
𝜃
𝑟
𝜃
𝑜
1 10
10
2
You can assume that the default medium is air with . Since all of the medium information is stored
on the surface materials, one way to determine if you are exiting or entering an object (i.e., a different
medium) is by testing the hit_data.is_backfacing flag.
ⓘ
𝜂 = 1.0
Deliverable 4 [10 points]
Modify your A4Renderer's render() implicit path tracer implementation to support caustics, by
implementing refraction and TIR.
☑
✒
资源评论
pk_xz123456
- 粉丝: 2598
- 资源: 3652
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功