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

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

总结
主要展示了PathTracer功能实现的主要代码,不过没有具体的路径追踪实现代码,具体路径追踪过程将在之后展示。
边栏推荐
猜你喜欢

Scala download and idea installation of scala plug-ins (nanny level tutorial is super detailed)
![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](/img/2c/63f1c865105a74ed651bb0ef97ab60.png)
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

Servlet连接数据库实现用户登录功能

Servlet knowledge explanation (2)

Getting started with JMeter

Dart typedef的理解

IGMP message (tcp/ip details volume 1/ Volume 2)

华为设备配置CE双归属

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

Golang collaboration scheduling (I): Collaboration Status
随机推荐
Solution of user and root forgetting password in virtual machine
一步步创建包含自定义 Screen 的 ABAP 程序的详细步骤试读版
5G新方案!升级现有的基站和UE模拟器至5G毫米波频段
Redis string type common commands
Explore the Apache shardingsphere SQL parse format function
Two ways of array simulating queue
Solving multithreading security problems
2022.02.28 - SX11-05. The largest rectangle in the histogram
Web UI automation test
Use of packet capturing tool Fiddler: simulating speed limit test process in weak network environment
Microservice fault tolerance
作業提交說明 上傳作業到網盤中
Daily leetcode - 3 Longest substring without duplicate characters
Servlet连接数据库实现用户登录功能
写代码也有本手俗手之分,而我们要善于发现妙手!
广播和多播(TCP/IP详解卷1/2)
远程操控其它电脑--详细教程
File uploading and downloading in SSM
VIM installation and common commands
Multi thread knowledge induction