当前位置:网站首页>Project training of Software College of Shandong University rendering engine system basic renderer (IV)
Project training of Software College of Shandong University rendering engine system basic renderer (IV)
2022-06-12 15:51:00 【chenxiang_ two hundred thousand one hundred and eight】
< Project training of Software College of Shandong University > Rendering engine system —— Base renderer ( Four )
Preface
This project hopes to implement a basic renderer , At the same time, it can support the use of precomputing . This article focuses on PathTracer Specific code .
Project address
One 、 Basic logic
Based on the idea of basic path tracking : To calculate the contribution of the path corresponding to each pixel , We first initialize the path . Depending on the corresponding pixel from VBuffer After reading the hit point information in , For this hit point , We first calculate the contribution of direct illumination . Because we support multiple importance sampling , So we need to sample the light source when calculating the direct illumination contribution , For different light sources , We distinguish between different ways of calculating contributions , This contribution is then superimposed on this ray result . Of course , If the sampled light source does not actually contribute to the hit point , Then we will ignore it .
After calculating the contribution of direct illumination , We generate and track scattered rays , The direction of the light is determined by BRDF Sampling acquisition of . For tracking the hit results , We saved it . If we don't hit the object in the scene , Then we sample the ambient light directly and add its contribution to the path . If we hit , Then update the current path throughput, After that, take the new hit point as the starting point to continue the tracking similar to the above .
Two 、 Main function code
1、 Define resources in the header file

2、Pass Structure and resources
This part is related to VBuffer similar , Quantity only 、 And so on , No more specific display code .
3、Shader Track the path within

summary
It mainly shows PathTracer The main code of function realization , However, there is no specific path tracking implementation code , The specific path tracking process will be shown later .
边栏推荐
- UDP summary (tcp/ip details volume 1/2)
- [practical case of light source] UV-LED curing innovation makes the production line more smooth
- [game server design cases] insights
- Design concept of ORM framework
- Fiddler packet capturing (mobile app)
- Escape rules and examples of go
- Idea大全(转载)
- What is reflection-- The soul of frame design
- SOA Architecture
- Example of bit operation (to be continued)
猜你喜欢

Fiddler packet capturing (mobile app)

Idea大全(转载)

华为设备配置CE双归属

从斐波那契数列求和想到的俗手、本手和妙手

写代码也有本手俗手之分,而我们要善于发现妙手!

< 山东大学软件学院项目实训 > 渲染引擎系统——辐射预计算(九)

Why doesn't Alibaba recommend MySQL use the text type?

What is reflection-- The soul of frame design

Servlet connects to database to realize user login function

小飞页升级变智能修复Bug更快速了
随机推荐
Introduction to Eureka
2021-06-27
redis String类型常见命令
C language partition bin file program
mysql Blob和Text类型
sql server 2008 的导入导出步骤
Codeworks round 797 (Div. 3, cf1690)
Solutions to some problems of scuacm22 retreat competition before summer training
Five models of software testing
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
Conversion between sparse array and array and file reading and writing
如何使用Grafana轻松实现OVL数据可视化
IGMP message (tcp/ip details volume 1/ Volume 2)
Step by step to create a trial version of ABAP program containing custom screen
记一篇IT培训日记067-好人感恩,坏人无错
Explanation of socket principle (where, what and how to use it)
The difference between TCP and UDP, the three handshakes of TCP and the four waves of TCP
Axure RP 9 for Mac(交互式产品原型设计工具)中文版
Why doesn't Alibaba recommend MySQL use the text type?
< 山东大学软件学院项目实训 > 渲染引擎系统——基础渲染器(三)