03.Unity ShaderGraph序列(Unity相关设置扫盲01)

Scriptable Render Pipeline(SRP)
Graphics
Shader All

What is the Scriptable Render Pipeline

The Scriptable Render Pipeline (SRP) is a feature that gives you full control over Unity’s render pipeline and provides the tools you need to create modern, high-fidelity graphics in Unity.

SRP allows you to write C# scripts to control the way Unity renders each frame. Exposing the render pipeline to you in C# makes Unity less of a “black box” when it comes to rendering. Unlike the original built-in render pipeline, SRP allows you to see and control exactly what happens during the rendering process.

Unity provides you with two prebuilt Scriptable Render Pipelines which you can use in your Projector as a base for your own custom SRP:

  • The Lightweight Render Pipeline (LWRP) offers graphics that scale from mobile platforms to higher-end consoles and PCs.
  • The High Definition Render Pipeline (HDRP) utilizes physically-based lighting techniques to offer high-fidelity graphics to target modern, Compute Shader compatible, platforms.

Rather than developing your own SRP from scratch, you can use either of these prebuilt SRPs as a base to modify and adapt to your own requirements.

什么是Scriptable Render Pipeline

SRP是一个功能,可以给你全部的渲染管线控制权,并且提供了你需要的工具,包括用Unity创建次世代、高精准显示;
SRP允许你写C#代码来控制Unity每帧的渲染方式;暴露渲染管线到你C#代码,使Unity减少了一个"black box",当数据来自渲染;
不像通常内建的渲染管线,SRP允许你看到并且控制在渲染过程中的实现。
Unity提供了两个预建SRP,你可以使用这些在你项目里面当作你自定义SRP的基础:
轻度渲染管线(LWRP)提供显示,最小适配到移动平台最高更高级控制中心和PC平台;
高清渲染管线(HDRP),应用了基于物理的光照技术,提供了高精准显示次世代目标,PC级别平台的着色器;
宁愿无止步的开发你自己的SRP,你也可以这些预建的SRPs作为基础修改,并且适配到你自己的需求。

Graphics

03.Unity ShaderGraph序列(Unity相关设置扫盲01)


Scriptable Render Pipeline Settings

制作的Assets需要放到这里,来控制显示效果


Tier Settings

设置需要显示的等级,分为高中低等级,点击OpenEditor…进入设置
可以分别设置Low、Medium、High不同等级的Tier
也可以直接使用Use Defaults来使用默认的设置
这个设置有点和Quality类似,Quality是负责整体游戏的质量水平,通常说的游戏高中低画质是
由Quality决定的,这里设置是专门负责PBR,高清渲染管线相关的参数。


Built-in Shader Settings

这个存放的是内建Shader,这些Shader在编译打包的时候会自动打包到基础包里面;如果有定义Shader,不用
AssetsBundle加载的话,需要把自定义的Shader添加到这里。


Shader Stripping

剔除Shader,减少编译大小,提高loading速度;
Lightmap Modes 光照贴图模型剔除
Fog Modes 雾贴图模型剔除
Instancing Variants 实例变体剔除
一般情况下,这些设置即可,由于压根没有能力去定制光照渲染和迷雾渲染的相关事宜;
由Unity自行决定就好,如果出现剔除有问题可以找回来看看


Shader Preloading

预加载的Shader,必须是Shader变体集合,如果有部分Shader使用率频繁,可以使用预加载Shader来提高帧率


Shader All

Unity包括ShaderGraph可以创建的Shader有7种

Standard Surface Shader
Unlit Shader
Image Effect Shader
Compute Shader
PBR Graph Shader
Sub Graph Shader
Unlit Graph Shader
03.Unity ShaderGraph序列(Unity相关设置扫盲01)

Standard Surface Shader

表面着色器,拥有固定的输入输出io,能实现的效果比较少;是Unity二次封装之后的一种Shader,具体用法未知,简介而已。

Unlit Shader

定点着色器,用户自行处理各个顶点的渲染方式

Image Effect Shader

图片特效处理Shader,专门对图片特效来处理,配合相机效果制作AE

Compute Shader

逻辑计算Shader,使用显卡的并发处理能力来分担处理一些多任务的渲染


PBR Graph

Physical Base Renderer基于物理的渲染可视化编程图表,用于高精度模型,地表,人物,刻画细节的都可以

Sub Graph

子图表,用于PBR多次复用,或者自定义节点图表

Unlit Graph

非光照图表,用于UI、特效