当前位置:网站首页>Unity-Post Processing
Unity-Post Processing
2022-08-02 14:11:00 【莉萝爱萝莉】
1. 基础使用
- 在Package Manager 中安装 Post Processing
- 在 Project 中创建 Profile 配置文件
- 创建空物体,并添加 Post Process Volume 组件
- 将配置文件拖拽到 Volume 组件上,勾选 isGlobal 全局响应
- 将创建的空物体右上角定义为 Post Process Layer
- 选中主摄像机,添加 Post Process Layer 组件,并在组件中选择刚创建的 layer 层
2. 基础使用
- Ambient Occlusion 环境光遮蔽
用于增强3D游戏中的暗部效果,使画面更真实更有层次感。 - Bloom 辉光效果
给一个强光源一个外发的光晕
| 名称 | 效果 |
|---|---|
| Intensity | 强度 |
| Threshold | 阈值 |
| Dirtiness | 光照的效果材质 |
Chromatic Aberration 色差效果(边缘动态模糊)
Vignette 边角压暗
Grading Curves 色阶 (需点击overriding方可更改)
Auto Exposure :自动曝光,根据图像包含的亮度级别范围动态调整图像的曝光
名称 描述 Filtering 过滤器,设置直方图的上下百分比,找到稳定的平均亮度。超出此范围的值将被丢弃,不会影响平均亮度。 Minimum 设置环境光当中最小平均亮度 Maximum 设置环境光当中最大平均亮度 Exposure Compensation 曝光补偿,设置中灰色值来补偿场景的全局曝光。 Adaptation settings:
名称 描述 Type 选择适应类型。progressive的自动曝光。fix的自动曝光。 Speed Up 设置从黑暗环境到光明环境的适应速度. Speed Down 设置从光亮环境到黑暗环境的适应速度。
3. 代码操作
- 常规使用
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
public class UnityEffects : MonoBehaviour
{
void Start()
{
// 获取
var volume = GetComponent<PostProcessVolume>();
Vignette vignette;
volume.profile.TryGetSettings(out vignette);
// 修改(某一属性)值
vignette.intensity.value = 1;
vignette.intensity.Override(1);
}
}
- 纯代码创建
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
public class UnityEffects : MonoBehaviour
{
PostProcessVolume volume;
Vignette vignette;
void Start()
{
// 创建到内存中
vignette = ScriptableObject.CreateInstance<Vignette>();
vignette.enabled.Override(true);
vignette.intensity.Override(1);
}
void OnDestroy()
{
// 释放
RuntimeUtilities.DestroyVolume(volume, true, true);
}
}
4. post-process layer 设置
- Anti-aliasing 反锯齿

边栏推荐
猜你喜欢
随机推荐
模板系列-二分
Ubuntu通过apt安装Mysql
How to simulate 1/3 probability with coins, and arbitrary probability?
Codeforces Round #605 (Div. 3)
Happy, 9/28 scene collection
Installation and configuration of Spark and related ecological components - quick recall
第二十六章:二维数组
mysql学习总结 & 索引
网络安全抓包
Introduction to in-order traversal (non-recursive, recursive) after binary tree traversal
What is Win10 God Mode for?How to enable God Mode in Windows 10?
golang之GMP调度模型
C语言函数参数传递模式入门详解
背包问题-动态规划-理论篇
剑指offer:反转链表
第二十七章:时间复杂度与优化
5.事务管理
推开机电的大门《电路》(一):电压,电流,参考方向
Detailed introduction to the hierarchical method of binary tree creation
Win11 keeps popping up User Account Control how to fix it









