forked from cotes2020/jekyll-theme-chirpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
title: UE5 描边效果 | ||
date: 2024-09-29 15:51 +0800 | ||
categories: | ||
- Game Development | ||
- Unreal Engine | ||
tags: | ||
- ue | ||
- effect | ||
--- | ||
## 1. 自定义深度缓冲区 | ||
|
||
### 1.1 缓冲区 | ||
|
||
引擎将三维物体渲染到屏幕上的过程(渲染管线)中,所用到的一系列中间缓存 | ||
|
||
### 1.2 场景深度缓冲 | ||
|
||
储存物体上的像素到摄像机距离的缓冲区,像素距离摄像机越近,深度越浅,在编辑器对应视图中越黑 | ||
|
||
### 1.3 自定义深度缓冲 | ||
|
||
只有设置了 **渲染自定义模板通道** 选项的网格体才会在此缓冲区中拥有深度值,且深度值为手动指定值,其他未开启自定义模板并未指定深度值的物体,以及空白区域,深度值将会是一个非常大的值 | ||
|
||
使用前,需要将 **项目设置-引擎-渲染-后期处理-自定义深度模板通道** 设置为 **启用模板** | ||
|
||
## 2. 理论 | ||
|
||
假设现在要对自定义深度缓冲中,一个像素周围的八个像素求和,如图(假定未设置模板深度值的像素深度值为1000,网格体设置的自定义模板值为1),当像素不在物体上时: | ||
|
||
![PixelOutMesh](/assets/img/202409/PixelOutMesh.png) | ||
|
||
当像素在物体边界上时: | ||
|
||
![PixelOnMeshBorder](assets/img/202409/PixelOnMeshBorder.png) | ||
|
||
当像素在网格体内部时: | ||
|
||
![PixelInsideMesh](assets/img/202409/PixelInsideMesh.png) | ||
|
||
显然,这三种情况的求和结果分别为8000,1007和8,将这三个数减去一个较小的常数,例如100,结果的正负性分别为正数,较小的正数和负数,由此,可以大致判断一个像素相对于物体的位置,从而,使用在物体边界和物体内部的像素,减去物体内部的像素,就可以得到物体边界上的像素 | ||
|
||
## 3. 实际执行 | ||
|
||
### 3.1 设置自定义缓冲 | ||
|
||
将 **项目设置-引擎-渲染-后期处理-自定义深度模板通道** 设置为 **启用模板**,并使需要应用描边效果的物体渲染自定义深度 | ||
|
||
### 3.2 Post Process Volume | ||
|
||
在场景中添加 `Post Process Volume/后期处理体积` ,设置范围为无限大(可选) | ||
|
||
### 3.3 后期处理材质 | ||
|
||
创建新材质,并将材质的 `Material Domain` 属性更改为 `Post Process` ,将此材质添加到 `后期处理体积` 属性中的 `后期处理材料/PostProcess Materials` 中 | ||
|
||
在此材质中,获取 `Scene Textrue` 并将其属性中的 `Scene Texture Id` 设置为 `CustomDepth` 以获得自定义深度信息 | ||
|
||
(待完善) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: UE5 GAS-GameplayEffect中的堆叠样式 | ||
date: 2024-10-10 10:05 +0800 | ||
categories: | ||
- Game Development | ||
- Unreal Engine | ||
tags: | ||
- ue | ||
- gas | ||
--- | ||
## 按源聚合 | ||
|
||
指定当前 GameplayEffect 的单一源可以应用的次数上限,例如,指定生命回复效果的堆栈限制次数为2,使A角色向B角色施加此效果三次,则一个持续时间内,只有前两次有效 | ||
|
||
## 按目标聚合 | ||
|
||
指定单个目标可以应用此 GameplayEffect 的上限,例如指定持续回复的堆栈限制次数为2,当目标已有2个此效果时,持续回复效果的应用会无效 | ||
|
||
## 堆栈持续时间刷新策略 | ||
|
||
### 应用成功时刷新 | ||
|
||
实际效果为,当目标目前效果堆叠层数未达到限制时,增加一层堆叠,并且重置持续时间,当堆叠层数已达上限时,仅重置持续时间,实际效果还是很符合平常玩的游戏中的效果的,但是与这个选项的名字 **应用成功**时刷新 并不是特别的符合,*在堆叠已经达到上限,再次应用效果,虽然因为上限应用无效,也算应用成功吗? | ||
|
||
例如,指定持续回复的堆栈限制次数为2,效果为每秒回复1hp,持续10秒,当应用第一次此效果,此时角色每秒回复1hp,持续10秒,过了5秒,第二次应用此效果,此时角色 **每秒回复2hp,持续10秒** ,过了9秒,第三次应用此效果,此时角色还是每秒回复2hp,仅持续时间重新刷新为10秒 | ||
|
||
### 从不刷新 | ||
|
||
顾名思义,不刷新持续时间,其他与上个选项一致 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.