vault backup: 2026-05-03 20:37:58

This commit is contained in:
2026-05-03 20:37:58 +08:00
parent 4fb34c6f38
commit 83502d0874
37 changed files with 2411 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
---
title: 局部位置缩放
date: 2026-05-03 00:00:00
excerpt: 逐材质局部空间顶点缩放
tags:
- ARC
- Rendering
- VertexFactory
rating: ⭐
---
# 局部位置缩放
返回 [[Rendering]]
## 概述
允许通过材质图在局部空间Local Space对顶点位置进行缩放实现不依赖 Actor Transform 的比例调整。
## 实现
在各 VertexFactory 中通过 `VertexFactoryUpdateLocalPositionScale` 函数实现:
```hlsl
void VertexFactoryUpdateLocalPositionScale(
inout FVertexFactoryInput Input,
inout FVertexFactoryIntermediates Intermediates,
float3 scale)
{
Input.Position.xyz *= scale;
}
```
`USES_LOCAL_POSITION_SCALE` 宏控制启用,在世界变换之前应用。
## 使用场景
- 角色部件的动态缩放(如拳头放大的夸张动画效果)
- 不同 LOD 级别的微调
- 格斗游戏中攻击判定与视觉表现分离时的视觉调整
## 材质属性
`MP_LocalPositionScale`float3通过材质图控制。参见 [[自定义材质属性]]。
## 修改文件列表
| 文件 | 修改类型 |
|------|---------|
| `Shaders/Private/LocalVertexFactory.ush` | 新增缩放函数 |
| `Shaders/Private/GpuSkinVertexFactory.ush` | 同上 |
| `Shaders/Private/LandscapeVertexFactory.ush` | 同上 |
| `Shaders/Private/MeshParticleVertexFactory.ush` | 同上 |
| 所有 Particle VertexFactory | 同上 |