Merge remote-tracking branch 'origin/master'

# Conflicts:
#	01-Diary/周小结/2024.8.md
This commit is contained in:
BlueRose 2024-08-30 16:32:02 +08:00
commit fa797aefa4
7 changed files with 136 additions and 16 deletions

View File

@ -2,7 +2,7 @@
Content/ResArt/CommandMaterial
- [x] [[#Functions]]
- [x] [[#MatCap]]
- [ ] [[#Materials]]
- [x] [[#Materials]]
- [ ] [[#MaterialInstance]]
- [x] [[#Outline]]
- [x] [[#Textures]]
@ -52,7 +52,7 @@ Content/ResArt/CommandMaterial
- **MF_ToonHairSpecularMaskUV**计算Hair高光贴图UV被MF_ApplyToonHairSpecular**M_ToonBase_V02**)调用。
- 使用dot( float3(0,0,1.0f), CaemraVector)的数值来对**HairMask的采样UVV轴** 进行偏移,以此实现高光偏移效果。
- **MF_ToonPBRInput**通用ToonPBR材质逻辑函数。集合了MF_CharacterMainLightIntensity、MF_Matcap、MF_Surface、**MF_ToonPBRInput**l材质函数以及一些变量材质设置。被**M_Penetrate**、**M_ToonBase_V01**、**M_ToonFace**、**M_ToonHair_V01**、**M_ToonSkin**、**M_BeiLa_Skin_AnotherWorld**、**M_Wave**。
- [ ] ***MF_TranslucentDOF***Translucent材质的景深效果***没有看懂***。被MF_Input、**MF_Surface**、**MF_Surface_V02**、M_ToonFacee_old、M_ToonLaserPBR调用。
- ***MF_TranslucentDOF***Translucent材质的景深效果***没有看懂***。被MF_Input、**MF_Surface**、**MF_Surface_V02**、M_ToonFacee_old、M_ToonLaserPBR调用。
- MF_VectorRotateAboutAxis向量旋转函数。被MF_WorldSpaceStarring调用。
- MF_WorldSpaceStarring被M_NaiLin_AnotherWorld02调用。
- SceneEffectsCollection场景效果材质参数集**可能已经废弃因为UE5大世界不支持关卡流**。会被MF_SceneEffects、BP_EmptyToStageA以及其他材质调用。
@ -268,15 +268,15 @@ return Result;
- MI_EyeShadow_V02
- MI_MakeUp_V02
- MI_TeethTongue_V02
- [ ] **M_Eye_Highlight**
- [x] **M_Eye_Highlight**
- M_Hide隐藏模型用材质。
- [ ] M_Penetrate
- [x] M_Penetrate
- [x] **M_ToonBase_V01**主要的逻辑是MF_ToonPBRInput => MF_CharacterEffects。**默认的ShadingModel为14**,也就是**SHADINGMODELID_TOON_PBR**。
- [x] M_ToonBase_V02_Penetrate带有Penetrate功能的M_ToonBase_V01。
- [ ] **M_ToonFace**
- [ ] M_ToonFace_old
- [ ] **M_ToonHair_V01**
- [ ] **M_ToonSkin**
- [x] **M_ToonFace**
- [x] M_ToonFace_old
- [x] **M_ToonHair_V01**
- [x] **M_ToonSkin**
## M_ToonBase_V02
与M_ToonBase_V01相比。最主要的逻辑区别在于

View File

@ -0,0 +1,10 @@
---
title: Untitled
date: 2024-08-27 14:53:29
excerpt:
tags:
rating: ⭐
---
# 前言
- Bink Video for Unreal Engine https://dev.epicgames.com/documentation/en-us/unreal-engine/bink-video-for-unreal-engine
-

View File

@ -64,6 +64,9 @@ rating: ⭐⭐⭐
7. [ ] ToonPostProcess
1. [ ] ToonBloom
2. [ ] 实现一波Anti-Lut
3. [ ] 考虑其他风格的ToneMapper可能还是使用LUT更好调整 https://zhuanlan.zhihu.com/p/716759929?utm_psn=1812047639874760707
1. [ ] CCA Tonemapping
2. [ ] GT Tonemapping https://github.com/yaoling1997/GT-ToneMapping
8. [ ] ToonRimLighting
1. [ ] 后处理边缘光
2. [ ] Matcap
@ -90,16 +93,22 @@ rating: ⭐⭐⭐
17. [ ] Toon Debug模式可以让美术在材质进行进行简单的光照计算。
18. [ ] ToonShadow
1. ![[星穹铁道中下巴阴影处理.png]]
19. [ ] 考虑往GBuffer中添加更多数据考虑Velocity以及SingleLayerWater
19. [ ] LookDev场景
1. [ ] https://zhuanlan.zhihu.com/p/394608910
20. [ ] 考虑往GBuffer中添加更多数据考虑Velocity以及SingleLayerWater
1. ShaderMaterialDerivedHelpers.cppShader宏、GBufferInfo.cppGBuffer格式BasePassRendering.cpp950行SingleLayerWater写入GBuffer格式相关
2. 确定一下SingleLayerWater中VSMFiter与DistanceFieldShadow对渲染结果的影响之后在文档中说明。
20. [ ] 修复SIngleLayerWater的缩略图渲染渲染错误双击会有一瞬间的错误产生
21. [ ] ToonLumen、GI以及晕染效果实现。![[卡通渲染晕染效果.mp4]]
22. [ ] 在材质中实现ToonEye相关效果
21. [ ] 修复SIngleLayerWater的缩略图渲染渲染错误双击会有一瞬间的错误产生
22. [ ] 添加对应的Stat https://zhuanlan.zhihu.com/p/716644594
23. [ ] ToonLumen、GI以及晕染效果实现。![[卡通渲染晕染效果.mp4]]
24. [ ] 在材质中实现ToonEye相关效果
1. 【二次元人物眼睛如何变形?】 https://www.bilibili.com/video/BV14M4m1y71A/?share_source=copy_web&vd_source=fe8142e8e12816535feaeabd6f6cdc8e
1. 原视频 https://www.youtube.com/watch?v=euIyX9v8rvw
2. 眼睛建模 https://youtu.be/s2_7Q2IIvNY?si=fWiYjqcLFXzdeQ-B&t=126
23. [ ] Unreal Engine 5.4 Scene Extension https://zhuanlan.zhihu.com/p/706268007
25. 卡通渲染针对TAA的优化思路 https://zhuanlan.zhihu.com/p/678876237
1. https://www.bilibili.com/video/BV1BK411v7FY/?spm_id_from=333.788&vd_source=ea6df38502a795b7533aa33b78bf1159
2. https://zhuanlan.zhihu.com/p/20786650
26. [ ] Unreal Engine 5.4 Scene Extension https://zhuanlan.zhihu.com/p/706268007
1. [ ] 通过SceneExtension改进ToonObjectID这样可以减少对应ToonBuffer的精度来存其他数据。
2. [ ] https://www.bilibili.com/video/BV1fM4m1U7Tp/

View File

@ -7,8 +7,11 @@ rating: ⭐⭐
---
## 前言
视频推荐https://www.youtube.com/watch?v=ZRaeiVAM4LI
其他https://zhuanlan.zhihu.com/p/629225258
- 视频推荐:
- https://www.youtube.com/watch?v=ZRaeiVAM4LI
- 其他:
- https://zhuanlan.zhihu.com/p/629225258
- Tomlooman的优化建议:https://www.tomlooman.com/wp-content/uploads/2022/11/Unreal-Engine-Game-Optimization-on-a-Budget.pdf
GPU Visualizer工具显示命令 **ProfileGPU**
CPU优化方法:https://www.unrealengine.com/en-US/blog/how-to-improve-game-thread-cpu-performance
@ -23,6 +26,13 @@ CPU优化方法:https://www.unrealengine.com/en-US/blog/how-to-improve-game-thre
- we see that it is being called 10 times a frame
4. We then need to go look at who is calling AddLight via a break point. And see why adding a specific light or lights is so slow. Usually it is the case that a specific light being added in a way that is doing more work than actually needs to be done. (e.g. attaching / reattaching it)
# 优化前需做
- r.vsync 0
- t.maxfps 0
- SmoothFrameRate=False (Project Settings)
- Lighting Built & MapCheck Errors fixed.
- Packaged Game build
- 使用Standalone进行优化。
## 优化笔记
r.Lumen.DiffuseIndirect.MeshSDF.RadiusThreshold
让物体包围球的半径大于上述两个决定的数值的时候才参与mesh sdf的软追踪。
@ -212,3 +222,54 @@ UE5使用DLSS时需要关闭TAA并且调整[[ScreenPercentage与描边宽度
# 内存数据查看
- stat llm查看**虚拟内存数据**。需要在启动方式里添加`-llm`才会有数据。
- MemoryInsight需要在启动方式里添加`-trace=memory`之后才能在UnrealInsight中查看。
# 材质优化 MIN/MAX DRAW DISTANCE
使用DistanceCullFade节点将过远的部分给Cull掉。
![[Unreal-Engine-Game-Optimization-on-a-Budget_MINMAX DRAW DISTANCE.png]]
# FREEZERENDERING
冻结渲染以此查看剔除情况。
- FreezeRendering + ; (semi-colon) to fly with DebugCamera
- Verify occlusion is working as expected
- pause (Freeze Game Thread)
# LIGHT CULLING (Stationary & Movable)
- Automatic ScreenSize culling not strict enough
- MinScreenRadiusForLights (0.03)
- Cull earlier case-by-case
- MaxDrawDistance
- MaxDistanceFadeRange
- Profiling
- Show > LightComplexity (Alt+7)
- Show > StationaryLightOverlap
- ToggleLight
# LEVEL STREAMING
关卡流调试方法
- Streaming Volumes vs. Manual Load/Unload
- Camera Location based (caution: third person view and cinematic shots)
- Cannot combine both on a specific sublevel, can mix within the game
- Profiling
- stat levels
- Loadtimes.dumpreport (+ loadtimes.reset)
- Unreal Insight
- UnrealInsight相关标签Look for level load & “GC” bookmarks
- UnrealInsight相关追踪内容loadtime,file categories
# Animation
## ANIMATION: FAST PATH
- Allow Fast Path by moving Computations out of AnimGraph (into EventGraph)
- Use WarnAboutBlueprintUsage to get warnings in AnimGraph
- Profiling
- stat anim
## ANIMATION: QUICK WINS
- **Update Rate Optimization (URO) for distant SkelMeshes**根据距离调整骨骼物体的更新频率该选项位于SkeletalMeshComponent。
- VisibilityBasedAnimTickOption (DefaultEngine.ini)
- OnlyTickPoseWhenRendered
- AlwaysTickPoseAndRefreshBones
- …
- More Bools!
- bRenderAsStatic UE5.2不存在该选项。
- bPauseAnims该选项位于SkeletalMeshComponent。
- bNoSkeletonUpdate该选项位于SkeletalMeshComponent。

View File

@ -165,7 +165,11 @@ Game Thread 造成的开销,基本可以归因于 C++ 和蓝图的逻辑处理
针对Tick可使用
- **stat game**:显示 Tick 的耗时情况
- **dumpticks**:可将所有正在 _tick_ 的 _actor_ 打印到 _log_ 中
- dumpticks grouped
- **stat tickables**
- **listtimers**
- **stat uobjects**
- [[#MOVING SCENE COMPONENTS]]
复杂逻辑:需要借助 Unreal Frontend Profiler / Unreal Insights 等工具对游戏逻辑中开销较大的代码进行定位。
### LandscapeSubsystem Tick
@ -234,6 +238,42 @@ Draw Thread 的主要开销来源于 **Visibility Culling** 和 **Draw Call**
- 对于纹理的优化,后续将另开新篇加以详细介绍
![](https://pic1.zhimg.com/80/v2-81aea063a7fd1de8c2eef38b355268bc_720w.jpg)
## 内存
- MEMREPORT -full
- Runs a number of individual commands for memory profiling
- obj list class=
- Example: obj list class=AnimSequence
- Only in Packaged Builds
- Example: AnimSequence twice as large in editor builds.
这样就就可以查看指定Object的内存占用情况。
## COLLISION & PHYSICS
- Unreal configured to work out of the box.
- “Collision Enabled” => Physics + Query
- Most things require just QueryOnly
- Disable on components players cant reach or interact with.
- Profiling
- stat physics, stat collision
- obj list class=BodySetup
- show CollisionPawn, show CollisionVisibility
- Tip: Landscape may use lower collision MIPs
## MOVING SCENE COMPONENTS
移动场景组件可能会造成一些性能问题,需要注意以下几点:
- Move/Rotate only once per frame
- **Disable Collision & GenerateOverlaps=False**
- AutoManageAttachment
- Audio & Niagara
- Profiling
- stat component
### MOVING COMPONENTS - BOUNDS
- ***UseAttachParentBound=True***
- Skips “CalcBounds”
- 检查命令show Bounds / showflag.bounds 1
蓝图中勾选***UseAttachParentBound***以此跳过计算CalcBounds的问题。
## UnrealFrontend Profiler
官方文档:[Profiler Tool](https://docs.unrealengine.com/4.27/zh-CN/TestingAndOptimization/PerformanceAndProfiling/Profiler/)
其他参考文章:

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB