GAMES102 Lecture 14 Ray Tracing 2
这里回顾GAMES101 Lecture 14,这一讲完成了加速结构,介绍了辐射度量学。
课程主页:
https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html
课程作业:
http://games-cn.org/forums/topic/allhw/
课程视频:
https://www.bilibili.com/video/BV1X7411F744?spm_id_from=333.337.search-card.all.click
本讲内容
如何使用AABB加速光线追踪的计算过程,即如何加速和物体求交;
均匀格子;
空间划分;
辐射度量学;
基本思路
对于光线和物体求交的过程;
我们先考虑光线和物体包围盒求交;
如果和包围盒有交点,即和物体求交;
均匀空间划分(格子)预处理对于空间中的物体,首先找到包围盒:
其次将盒子划分为格子:
最后判定哪些格子中有物体表面(下图中标记为灰色):
光线场景相交有了之前的准备工作,可以介绍光线和场景的相交:
光线穿按顺序穿过网;
对于每个格子:
测试与在该格子内所 ...
Deep Learning Systems HW2
这里回顾HW2,主要是实现一个基本的自动微分框架。
课程主页:
https://dlsyscourse.org/
https://forum.dlsyscourse.org/
https://mugrade-online.dlsyscourse.org/
参考资料:
https://forum.dlsyscourse.org/t/q3-tensor-dtype-mismatch/2297/3
https://forum.dlsyscourse.org/t/q3-sgd-weight-decay/2262/9
https://forum.dlsyscourse.org/t/q3-memory-check-with-adam-failed/2373
https://forum.dlsyscourse.org/t/q3-can-not-pass-any-test-of-adam-fixed/2398/7
https://forum.dlsyscourse.org/t/q3-numerical-issue-in-sgd-and-adam/2279/16
https://forum.dls ...
GAMES101 HW6
这里回顾GAMES101 HW6,这次作业的内容是加速结构。
课程主页:
https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html
课程作业:
http://games-cn.org/forums/topic/allhw/
课程视频:
https://www.bilibili.com/video/BV1X7411F744?spm_id_from=333.337.search-card.all.click
参考资料:
https://www.cnblogs.com/lookof/p/3546320.html
https://segmentfault.com/a/1190000041774408
Render微调之前的代码即可:
for (uint32_t j = 0; j < scene.height; ++j) {
for (uint32_t i = 0; i < scene.width; ++i) {
// generate primary ray dir ...
GAMES101 HW5
这里回顾GAMES101 HW5,这次作业的内容是光线与三角形相交。
课程主页:
https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html
课程作业:
http://games-cn.org/forums/topic/allhw/
课程视频:
https://www.bilibili.com/video/BV1X7411F744?spm_id_from=333.337.search-card.all.click
参考资料:
https://zhuanlan.zhihu.com/p/431092843
Render首先要将屏幕上的像素点恢复成对应的物体坐标,而从物体坐标变成像素点即Lecture 4和Lecture5介绍的方法。
第一步,从物体坐标变成标准立方体:
第二步,从标准立方体投影到屏幕:
像素的索引采用$(x, y)$的形式,其中$x$和$y$都是整数;
像素的索引从$(0, 0)$到$(width - 1, height - 1)$;
像素$(x, y)$以$(x + 0.5, y + 0.5)$为 ...
GAMES101 HW4
这里回顾GAMES101 HW4,这次作业的内容是贝塞尔曲线。
课程主页:
https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html
课程作业:
http://games-cn.org/forums/topic/allhw/
课程视频:
https://www.bilibili.com/video/BV1X7411F744?spm_id_from=333.337.search-card.all.click
recursive_bezierrecursive_bezier使用讲义中介绍的递归算法实现即可:
cv::Point2f recursive_bezier(const std::vector<cv::Point2f> &control_points, float t)
{
// TODO: Implement de Casteljau's algorithm
int n = control_points.size();
if (n == 1) {
...
GAMES102 Lecture 13 Ray Tracing 1
(Whitted-Style Ray Tracing)
这里回顾GAMES101 Lecture 13,这一讲介绍了光线追踪(基本原理)。
课程主页:
https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html
课程作业:
http://games-cn.org/forums/topic/allhw/
课程视频:
https://www.bilibili.com/video/BV1X7411F744?spm_id_from=333.337.search-card.all.click
为什么需要光线追踪?
光栅化无法很好地处理全局效果:
(软)阴影;
光线反射多次;
光栅化速度很快,但质量相对较低;
光线追踪很准确,但速度很慢;
光栅化:实时;
光线追踪:离线;
大约10K CPU核心小时在产品中渲染一帧;
基本光线追踪算法光线关于光线的三个想法(图形学中的基本假设):
光以直线传播(虽然这是错误的);
光线交叉时不会相互“碰撞”(虽然这仍然是错误的);
光线从光源传播到眼睛(可逆性,也可以理解为光线从眼角传播到光源);
光线投射基本流程:
对每像素投射一条射 ...
GAMES102 Lecture 12 Geometry 3
这里回顾GAMES101 Lecture 12,这一讲会继续介绍曲面。
课程主页:
https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html
课程作业:
http://games-cn.org/forums/topic/allhw/
课程视频:
https://www.bilibili.com/video/BV1X7411F744?spm_id_from=333.337.search-card.all.click
本讲内容网格操作中的几何处理部分:
网格细分;
网格简化;
网格正则化;
网格细分是指上采样,即增加分辨率:
网格简化是指下采样,即降低分别率,并且尽量保持形状:
网格正则化(使用相同的三角形,修改样本分布以提高质量):
后续会介绍这些操作的细节。
网格细分Loop细分Loop细分是三角形网格的常用细分规则:
创建更多的三角形(顶点);
调整位置;
例子:
来看下具体细节。
将每个三角形一分为四;
根据权重分配新的顶点位置;
新/旧顶点更新方式不同;
更新对于新顶点:
更 ...
GAMES102 Lecture 11 Geometry 2 (Curves and Surfaces)
这里回顾GAMES101 Lecture 11,这一讲介绍了曲线与曲面。
课程主页:
https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html
课程作业:
http://games-cn.org/forums/topic/allhw/
课程视频:
https://www.bilibili.com/video/BV1X7411F744?spm_id_from=333.337.search-card.all.click
本讲内容这一讲介绍的内容:
显式表示
曲线
贝塞尔曲线
De Casteljau算法
B样条等
曲面
贝塞尔曲面
三角形和四边形
细分、简化、正则化
计算机图形学中的显式表示点云
点云是最简单的表示方法:点列表$(x,y,z)$;
轻松表示任何类型的几何图形;
适用于大型数据集(>>1 点/像素);
经常转换成多边形网格;
难以在采样不足的区域中绘制;
多边形网格
存储顶点和多边形(通常是三角形或四边形);
更容易进行处理/模拟,自适应采样;
更复杂的数据结构;
也许是图形学中 ...
Deep Learning Systems HW1
这里回顾HW1,主要是实现一个基本的自动微分框架。
课程主页:
https://dlsyscourse.org/
https://forum.dlsyscourse.org/
https://mugrade-online.dlsyscourse.org/
参考资料:
https://forum.dlsyscourse.org/t/q3-topologic-sort-inputs-is-not-a-node-list-solved/1995
https://blog.csdn.net/qq_34384524/article/details/86892864
https://en.wikipedia.org/wiki/Topological_sorting#Depth-first_search
https://forum.dlsyscourse.org/t/q4-how-to-multiply-the-partial-derivative/2131
https://forum.dlsyscourse.org/t/q4-reverse-mode-ad-test-throws-grad- ...
Deep Learning Systems HW0
这里回顾HW0,主要是熟悉代码和复现一些基本的反传。
课程主页:
https://dlsyscourse.org/
https://forum.dlsyscourse.org/
https://mugrade-online.dlsyscourse.org/
参考资料:
https://github.com/hsjeong5/MNIST-for-Numpy/blob/master/mnist.py
https://mattpetersen.github.io/load-mnist-with-numpy
Question 1: A basic add function, and testing/autograding basics这部分没有难度,主要是熟悉代码:
def add(x, y):
""" A trivial 'add' function you should implement to get used to the
autograder and submission system. The solution to this problem is in ...
Deep Learning Systems 开发环境配置
最近开始学习Deep Learning Systems,这里介绍下开发环境配置的问题。
课程主页:
https://dlsyscourse.org/
https://forum.dlsyscourse.org/
https://mugrade-online.dlsyscourse.org/
参考资料:
https://github.com/WassimBenzarti/colab-ssh
https://www.youtube.com/watch?v=RMCRwjnv2MI
https://github.com/astrada/google-drive-ocamlfuse
准备工作在线版本可以填一个表格,然后老师会邀请你,可以使用CMU的作业检测系统,最后完成课程也会有一个证书。
一些问题
这次开发环境配置的最主要问题是,老师提供的作业都是google colab的形式,这样无法在线编辑代码,开发效率较低,网上提供的基于ssh的插件并不好用,最后查了资料之后还是利用google云端硬盘客户端和vscode最香(windows);在linux环境,由于没有google云端硬盘客 ...
GAMES101 HW3
这里回顾GAMES101 HW3,这次作业的内容是Pipeline and Shading。
课程主页:
https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html
课程作业:
http://games-cn.org/forums/topic/allhw/
课程视频:
https://www.bilibili.com/video/BV1X7411F744?spm_id_from=333.337.search-card.all.click
参考资料:
https://logic-three-body.github.io/post/games101-greaterassignment3-shader-and-graphic-pipeline/
https://games-cn.org/forums/topic/zuoye3faxiantietugenweiyitietulidekhhekndoushisha/
http://games-cn.org/forums/topic/%e4%bd%9c%e4%b8%9a3%e6%9 ...