vault backup: 2023-07-18 15:24:19

This commit is contained in:
BlueRose 2023-07-18 15:24:19 +08:00
parent df60fe814c
commit 5db87dd0e8
3 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,54 @@
---
title: 使用Curve进行深度适配的Outline
date: 2023-07-18 14:47:24
excerpt:
tags:
rating: ⭐
---
# 前言
在UE5.1发现了若干新节点感觉对后处理描边有很大的作用。
![[MultiDraw_OutlineMaterial.png]]
UE单位为cm理论上范围为10cm~10000cm1000m。假设标准的角色身高为180cm110~200cm变化比较轻微定义一个标准数StandardCharacterHeight。
经过观察`10~StandardCharacterHeight * 2`范围适合使用CurveTexture超过StandardCharacterHeight * 2的区域基本是一个线性区间。
{360 0.5} {10000 0.018}
斜率 k = 0.0005/1cm
x轴 10=>0 , 180 => 1
-18=0 , -0.018
15 20 25 30 40 60 100
-12 -9 -7.2 -6 -4.5 -3 -1.8
0.33 0.25 0.2 0.1666 0.125 0.08333 0.05
0.667 0.75 0.8 0.83334 0.875 0.91666 0.95
最终斜率使用0.002
half invLerp(half from, half to, half value)
{
return (value - from) / (to - from);
}
half invLerpClamp(half from, half to, half value)
{
return saturate(invLerp(from,to,value));
}
// full control remap, but slower
half remap(half origFrom, half origTo, half targetFrom, half targetTo, half value)
{
half rel = invLerp(origFrom, origTo, value);
return lerp(targetFrom, targetTo, rel);
}
以下去本人设置的曲线:![[MultiDraw_OutlineCurve.png]]]

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB