当前位置:网站首页>< 山东大学软件学院项目实训 > 渲染引擎系统——基础渲染器(五)
< 山东大学软件学院项目实训 > 渲染引擎系统——基础渲染器(五)
2022-06-12 15:45:00 【chenxiang_200108】
< 山东大学软件学院项目实训 > 渲染引擎系统——基础渲染器(五)
前言
本项目希望实现一个基础渲染器,同时能够支持使用预计算。本篇文章主要讲解PathTracer具体路径追踪过程代码。
项目地址
一、基础逻辑
与上一文相同,要计算每一个像素点对应路径的贡献,我们首先初始化路径。在依靠对应像素从VBuffer中读取到击中点信息后,对于此击中点,我们首先计算直接光照的贡献。因为我们支持多重重要性采样,所以在计算直接光照贡献时我们需要对光源进行采样,对于不同的光源,我们区分不同的贡献计算方式,之后将此贡献叠加到此光线结果中。当然,如果采样得到的光源实际对击中点没有贡献,那我们会忽略它。
在计算完直接光照的贡献之后,我们生成并追踪散射光线,光线的方向由对BRDF的采样获得。对于追踪的击中结果,我们保存下来。如果我们没有击中场景中的物体,那么我们直接对环境光进行采样并将其贡献叠加到路径中。若是我们击中了,那么就更新当前路径的throughput,之后以新击中点为起点继续与上述类似的追踪。
二、主要功能代码
1、主体追踪框架

2、对于Diffuse和Glossy物体采样直接光

3、生成Glossy散射光

4、生成Diffuse散射光

5、生成Glass散射光

6、生成Mirror散射光

7、追踪散射光

8、Gloosy散射光击中物体

9、Gloosy散射光未击中物体

10、Diffuse散射光未击中物体

11、Specular散射光击中物体

12、Specular散射光未击中物体

总结
主要展示了PathTracer功能具体实现的主要代码,即具体路径追踪过程的相关代码。
边栏推荐
- Design concept of ORM framework
- Acwing summer daily question (sexy prime number on June 10)
- Differences between microservice architecture and SOA Architecture
- < 山东大学软件学院项目实训 > 渲染引擎系统——点云处理(十)
- 从斐波那契数列求和想到的俗手、本手和妙手
- Distributed concurrent repeated submission
- Task output: dense snow ice city theme song 0612
- Decision tree classification and examples
- The difference and brief description of "file name" and < file name > import header file used in # include
- SCUACM22暑假集训前劝退赛部分题解
猜你喜欢

What is reflection-- The soul of frame design

Change according to the situation, the road to promotion in the second half of 2022

Dart typedef的理解

Explanation of socket principle (where, what and how to use it)

Idea Encyclopedia (Reprinted)

Solving multithreading security problems
![[jvm learning] local method stack and heap](/img/5d/2e0b758ae52cfdc0d060431df19eea.jpg)
[jvm learning] local method stack and heap

How to use grafana to easily realize OVL data visualization

FPGA (III) trigger and latch

Deepin20.6 RTX3080 安裝顯卡驅動510.60.02、CUDA11.6、PyTorch1.11
随机推荐
Classification of annotations
Defer learning in golang
Two implementation methods of generic interface
From K-means to capsule
Golang collaboration scheduling (I): Collaboration Status
VIM installation and common commands
Distributed concurrent repeated submission
redis String类型常见命令
Loadbalancer load balancer
作業提交說明 上傳作業到網盤中
< 山东大学软件学院项目实训 > 渲染引擎系统——辐射预计算(九)
位运算例题(待续)
Introduction and download website of common data of GIS, remote sensing, hydrology and Geography (2), supplementary~
FPGA (III) trigger and latch
鼻孔插灯,智商上升,风靡硅谷,3万就成
Self induction of exception handling
jupyter notebook新环境快捷方式
POSTMAN-REST Client插件的应用
Solving multithreading security problems
Why doesn't Alibaba recommend MySQL use the text type?