当前位置:网站首页>< 山东大学软件学院项目实训 > 渲染引擎系统——基础渲染器(五)
< 山东大学软件学院项目实训 > 渲染引擎系统——基础渲染器(五)
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功能具体实现的主要代码,即具体路径追踪过程的相关代码。
边栏推荐
猜你喜欢

Task output: dense snow ice city theme song 0612

TCP与UDP的区别,以及TCP的三次握手和TCP的四次挥手

UDP summary (tcp/ip details volume 1/2)

Use of packet capturing tool Fiddler: simulating speed limit test process in weak network environment

广播和多播(TCP/IP详解卷1/2)
![[automation] kolla Based Automated Deployment CEPH cluster](/img/d8/fdfd166204242faba406220f548ea5.jpg)
[automation] kolla Based Automated Deployment CEPH cluster

Two ways of array simulating queue

Increase the maximum number of MySQL connections

RARP总结(TCP/IP详解卷1/2)
![[jvm learning] class loading subsystem](/img/60/e863495ce4ea5826d1404a73c90033.jpg)
[jvm learning] class loading subsystem
随机推荐
ARM 64指令小记
Solving multithreading security problems
Broadcast and multicast (tcp/ip details volume 1/2)
sql server 2008 的导入导出步骤
Method reference instance method reference
Find the number of cells (connectivity map, wide search, deep search)
CUDA out of memory or brokenpipeerror: [errno 32] broken pipe or oserror: [winerror 1455] solution to the problem that the page file is too small
Idea大全(转载)
2021-06-27
Deepin20.6 rtx3080 installer le lecteur de carte graphique 510.60.02, cuda 11.6, pytorch1.11
[practical case of light source] UV-LED curing innovation makes the production line more smooth
Difference between tinyint and int
How to set public IP access on the H3C gr5200 router
Five models of software testing
Apache kylin Adventure
SCUACM22暑假集训前劝退赛部分题解
SOA Architecture
Escape rules and examples of go
What is reflection-- The soul of frame design
Servlet知识详解(2)