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

2、Pass构造与资源
此部分与VBuffer类似,仅数量、类型等不同,不再具体展示代码。
3、Shader内进行路径追踪

总结
主要展示了PathTracer功能实现的主要代码,不过没有具体的路径追踪实现代码,具体路径追踪过程将在之后展示。
边栏推荐
- UDP summary (tcp/ip details volume 1/2)
- Introduction to resttemplate
- 为什么阿里巴巴不建议MySQL使用Text类型?
- Dongmingzhu talks about batteries: the most essential thing is safety
- The difference and brief description of "file name" and < file name > import header file used in # include
- 安装rhel 7/8 (红帽)虚拟机(转载)
- [jvm learning] local method stack and heap
- Rust tip - running the tensorrt model through FFI programming
- Explore the Apache shardingsphere SQL parse format function
- 2021-06-27
猜你喜欢
随机推荐
Explanation of socket principle (where, what and how to use it)
Escape analysis of golang compiler
Classification of annotations
Module yaml error: Unexpected key in data: static_ context [line 9 col 3]
Two ways of array simulating queue
TS 22.011
go net库(待续)
Raccourci vers le nouvel environnement du carnet de notes Jupiter
[automation] kolla Based Automated Deployment CEPH cluster
Unity get local video / download network video
Using the CSDN markdown editor
一步步创建包含自定义 Screen 的 ABAP 程序的详细步骤
VIM installation and common commands
What is reflection-- The soul of frame design
vim的安装以及常用命令
Introduction and download website of common data of GIS, remote sensing, hydrology and Geography (2), supplementary~
Interface.
jupyter notebook新环境快捷方式
Remote control of other computers -- detailed tutorial
2022.02.28 - SX11-05. The largest rectangle in the histogram









