当前位置:网站首页>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 反锯齿

边栏推荐
- 二叉树的遍历:递归法/ 迭代法/ 统一迭代法(强QAQ)
- STM32LL库——USART中断接收不定长信息
- 7.Redis
- 关于混淆的问题
- Mysql lock
- [STM32 Learning 1] Basic knowledge and concepts are clear
- Network Security Packet Capture
- Detailed explanation of Golang garbage collection mechanism
- What is Win10 God Mode for?How to enable God Mode in Windows 10?
- pygame draw arc
猜你喜欢

Happy, 9/28 scene collection

Based on the least squares linear regression equation coefficient estimation

将SSE指令转换为ARM NEON指令

Open the door of power and electricity "Circuit" (2): Power Calculation and Judgment

Redis的线程模型

Redis常见面试题

测试用例练习

倍增和稀疏表

Summarize computer network super comprehensive test questions

mysql学习总结 & 索引
随机推荐
学习笔记(01):activiti6.0从入门到精通-工作流的介绍以及插件的安装
Configure clangd for vscode
Masters and Masters
1.开发社区首页,注册
General code for pytorch model to libtorch and onnx format
LeetCode 2343. 裁剪数字后查询第 K 小的数字 暴力+语法考察
In-depth understanding of Golang's Map
关于混淆的问题
第三十章:普通树的存储和遍历
倍增和稀疏表
What is Win10 God Mode for?How to enable God Mode in Windows 10?
couldn't find 'libflutter.so' --flutter
Happy, 9/28 scene collection
pygame draw arc
Exotic curiosity-a solution looking - bit operations
6. Unified logging
MATLAB图形加标注的基本方法入门简介
7.Redis
How to solve Win11 without local users and groups
二叉树创建之层次法入门详解