[Unity]URP学习记录(2)
在Shader的Inspector中,可以查看
Surface shader:URP不支持Surface shader,URP一般为no
如果Shader中 使用了
Fixed function:固定管线(老显卡)-URP一般为no
Compiled code:编译Shader并查看代码
Cast Shadows:投射阴影
Render queue:渲染次序
LOD:LOD值
Ignore projector:忽略投影
Disable batching:禁用合批
Keywords:编译宏
SRP Batcher: compatible / not compatible(兼容&非兼容)
CBUFFER_START(UnityPerMaterial)
CBUFFER_END
则兼容,反之不兼容
相关资料:
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@8.0/manual/index.html
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@8.0/manual/shaders-in-universalrp.html
配置URP
一、创建URPAsset
1、URPAsset 控制项目中全局的渲染和质量配置,
以及创建渲染管线实例(rendering pipeline instance),
渲染管线实例包含中间资源和渲染管线实现。
2、按以下步骤创建URPAsset
在编辑器Project中,Create > Rendering > Universal Render Pipeline > Pipeline Asset
二、将URPAsset配置到图形设置中
如果不配置,则Unity仍然使用内置渲染管线
1、Edit > Project Settings > Graphics
将URPAsset拖到 Scriptable Render Pipeline Settings
三、升级Shader
内置Shader不支持URP,需要进行切换
1、使用内置切换功能
Edit > Render Pipeline > Universal Render Pipeline
根据需求点 Upgrade Project Material to URP Materials 或者 Upgrade Selected Materials to URP Materials
Tips: 如果升级后Project中的缩略图错了,可以选择Reimport All
Tips: SpeedTree的Shader,需要 “Generate Materials”或者 “Apply & Generate Materils”
Shader升级列表
Unity built-in shader | Universal Render Pipeline shader |
Standard | Universal Render Pipeline/Lit |
Standard (Specular Setup) | Universal Render Pipeline/Lit |
Standard Terrain | Universal Render Pipeline/Terrain/Lit |
Particles/Standard Surface | Universal Render Pipeline/Particles/Lit |
Particles/Standard Unlit | Universal Render Pipeline/Particles/Unlit |
Mobile/Diffuse | Universal Render Pipeline/Simple Lit |
Mobile/Bumped Specular | Universal Render Pipeline/Simple Lit |
Mobile/Bumped Specular(1 Directional Light) | Universal Render Pipeline/Simple Lit |
Mobile/Unlit (Supports Lightmap) | Universal Render Pipeline/Simple Lit |
Mobile/VertexLit | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Diffuse | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Specular | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Bumped Diffuse | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Bumped Specular | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Self-Illumin/Diffuse | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Self-Illumin/Bumped Diffuse | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Self-Illumin/Specular | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Self-Illumin/Bumped Specular | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Transparent/Diffuse | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Transparent/Specular | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Transparent/Bumped Diffuse | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Transparent/Bumped Specular | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Transparent/Cutout/Diffuse | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Transparent/Cutout/Specular | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Transparent/Cutout/Bumped Diffuse | Universal Render Pipeline/Simple Lit |
Legacy Shaders/Transparent/Cutout/Bumped Specular | Universal Render Pipeline/Simple Lit |
Post Link: [Unity]URP学习记录(2)