当前位置:网站首页>Unity的URP的RenderFeature相关编程内容梳理
Unity的URP的RenderFeature相关编程内容梳理
2022-06-11 04:15:00 【ttod】
经过快一周浑浑噩噩的学习,终于把URP相关编程内容学糊涂了。
今天是周五,反省一下,安静下来,把相关的类逐个看清楚,也许没那么难。
现在这个逻辑好像是这样的,我的理解,可能不对。
添加RenderFeature就是在渲染管线中的特定位置添加了某个渲染指令,自定义的RenderFeature继承自ScriptableRenderFeature,内部执行的是自定义的RenderPass,自定义的RenderPass继承自ScriptableRenderPass,这里先对ScriptableRenderPass里面的几个方法的执行顺序做个说明:
1、ScriptabeRenderPass构造函数肯定第一个执行。
2、其次Configure
3、然后Execute
其实中间还有很多方法要执行,这里就简化成这3个。
RenderPass里面核心的功能是添加CommandBuffer,而添加CommandBuffer使用的是ScriptableRenderContext这个对象,ScriptableRenderContext提供了常用的CommandBuffer组合,类似DrawObjects方法,同时也可以通过它的ExecuteCommandBuffer来添加自定义的CommandBuffer组合r,分别说明如下:
1、DrawObjects
这个方法是根据可视的GameObject提供的Render组件来插入渲染命令,其使用参数如下:
a、cullingResults
Rendering.CullingResults类型,要绘制的可见对象集。通常可以从ScriptableRenderContext.Cull获取此内容,这个Cull方法的参数是ScriptableCullingParameters结构体类型,这个参数可以使用Camera.TryGetCullingParameters方法来获取,其原型为
bool TryGetCullingParameters(out ScriptableCullingParameters cullingParameters)
b、drawingSettings
DrawingSettings 通过SortingSettings对象描述如何对可见物体排序,并且通过ShaderPassName来决定使用哪个Shader Pass。
c、filterSettings
FilterSettings描述如何过滤可见对象集的结构体。如果使用默认值defaultValue相当于没有任何过滤。
d、stateBlock
e、tagName
f、isPassTagName
g、tagValues
h、renderTypes
i、stateBlocks
2、ExecuteCommandBuffer
这个方法的参数只有一个CommandBuffer对象,下面对这个对象做一个介绍。
这个对象的内容超级多,休息一下,过两天再写,呵呵。
边栏推荐
- Emlog新版导航源码/带用户中心
- Sql优化
- Introduction to the development and production functions of shop facade transfer and rental applet
- Market prospect analysis and Research Report of electronic pelletizing counter in 2022
- Golang generics: generics
- Personalized use of QT log module
- 特征工程 特征降维
- Explain in detail the structure and working principle of the crystal oscillator
- Feature selection algorithm based on bare bones particleswarm optimization
- Unity MonoSingleton
猜你喜欢

Guanghetong 5g module shines brightly and has won the "2021 science and technology award of China Electronics Society"

JVM (7): dynamic link, method call, four method call instructions, distinguishing between non virtual methods and virtual methods, and the use of invokedynamic instructions
![[激光器原理与应用-2]:国内激光器重点品牌](/img/55/a87169bb75429f323159e3b8627cc6.jpg)
[激光器原理与应用-2]:国内激光器重点品牌

Red team shooting range with three-layer protection

2022 love analysis · privacy computing vendor panoramic report | love Analysis Report

写给通信年轻人的27个忠告

司马炎爷爷 告诉你什么叫做内卷!

Guanghetong LTE CAT6 module fm101-cg, which supports CBRS band, took the lead in obtaining FCC certification

CRMEB/V4.4标准版打通版商城源码小程序公众号H5+App商城源码

Feature selection algorithm based on bare bones particleswarm optimization
随机推荐
店铺门面转让出租小程序开发制作功能介绍
Unity 消息框架 NotificationCenter
一款自适应的聊天网站-匿名在线聊天室PHP源码
Methods to detect whether PHP websites have been broken
From the first generation of sowing to the first generation of flowers, 5g commercial "gave birth to all things" for the third anniversary
Seven easy-to-use decorators
七个好用的装饰器
MySql索引
强大新UI装逼神器微信小程序源码+多模板支持多种流量主模式
Matter protocol
Unity 地图映射
Unity Editor Extension save location
Ultra simple cameraX face recognition effect package
Sql优化
Vulkan-官方示例解读-RayTracingShadows&在这里边使用模型(1)
Eth Transfer
直播助力杭州电商独角兽冲击上市,分账系统重构电商交易新格局
[激光器原理与应用-2]:国内激光器重点品牌
golang泛型:generics
Unity Advanced Backpack System