[UE4]console命令行常用命令(command)

先简单粗略的记录下一些控制台指令

Rendering

渲染优化分析视图模式:

//Lit view mode shows the final result of your scene once all of the Materials and lighting have been applied.
//Hotkey: Alt + 4
viewmode lit

//Unlit view mode removes all lighting from the scene, showing you Base Color only.
//Hotkey: Alt + 3
viewmode unlit

//Wireframe shows all of the polygon edges in the scene. In the case of Brushes, you will see the resultant geometry. 
//Hotkey: Alt + 2
viewmode wireframe

//Detail Lighting activates a neutral Material across the entire scene, using the normal maps of the original materials. This is useful for isolating whether your BaseColor is obscuring lighting by being too dark or noisy. 
//Hotkey: Alt + 5
viewmode lit_detaillighting

//Lighting Only shows a neutral Material that is only affected by lighting. It differs from Detail Lighting mode in that you will not see normal maps. 
//Hotkey: Alt + 6
viewmode lightingonly

//Light Complexity shows the number of non-static lights affecting your geometry. This is useful for tracking lighting cost - the more lights affecting a surface, the more expensive it will be to shade. 
//Hotkey: Alt + 7
viewmode lightcomplexity

//Shader Complexity Mode is used to visualize the number of shader instructions being used to calculate each pixel of your scene. It is generally a good indication of how performance-friendly your scene will be. In general, it is used to test overall performance for your base scene, as well as to optimize particle effects, which tend to cause performance spikes with a large amount of overdraw for a short period of time. 
//Hotkey: Alt + 8
viewmode shadercomplexity

//view quad overdraw
viewmode quadoverdraw

显示刚体:Show Collision
显示帧率:stat fps
显示mesh drawcall:stat scenerendering
显示UMG Widget drawcall:stat slate
显示static mesh、skeletal mesh的三角面数量:stat Engine
显示硬件级(RHI)三角面总数和drawcall总数:stat rhi

其中:
Render target memory是buffer(比如g-buffer)或shadow map等render target的内存大小。buffer大小取决于分辨率,shadow map大小取决于阴影质量。
Triangles drawn是最终绘制的面数,即camera frustum和occlusion culling之后的面数。数量包含了shadowmap和tessellation,所以数值会显著高于stat Engine中的三角面数;
DrawPrimitive calls数量除了geometry,还包括decals、shadows、translucent lighting volumes、post processing等,其数值也会明显高于stat scenerendering中的draw call数。

显示单帧信息:总时长、Game耗时、Draw耗时、GPU耗时:stat Unit、stat UnitGraph //附带各个参数的实时曲线图
显示当前帧的CPU时间信息(各种Tick, GC Mark,Update Overlaps等):stat game
设置渲染分辨率为默认大小的50%(500就表示实际viewport大小的5倍尺寸来渲染,可以用来做压力测试,判断性能瓶颈是不是像素处理)
r.ScreenPercentage 50
r.SetRes也可以判断瓶颈是否和像素相关。和r.ScreenPercentage功能相同,但r.ScreenPercentage有额外开销。

r.SetRes 1920x1080f
查看遮挡剔除:r.visualizeOccludedPrimitives 1
启用early Z pass,默认已开启:r.EarlyZPass 3
较高的drawcall情况下,开启后如果basepass的overdraw反而较少,说明early Z pass效果明显。修改值后需要重新运行游戏生效。

关闭或开启屏幕上打印信息(AddOnScreenDebugMessage) :DisableAllScreenMessages、EnableAllScreenMessages

Viewport高清截图
//以当前viewport分辨率的两倍进行截图
HighResShot 2

//指定分辨率截图
HighResShot 3840x2160
图片存储位置:\Saved\Screenshots\

Taking Screenshots

Dump Console Commands
Q:console的命令非常多,如何将所有命令全部dump出一个列表?
A:使用命令dumpconsolecommands,执行后,所有可用的命令会存储在\Saved\Logs\下的log文件中。

参考自:Where can I find all the console commands?

或者直接查看引擎源码:
Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp

bool UEngine::Exec( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar )
性能统计图工具 Session Frontend
用于记录某段时间内的性能分析数据。

**在需要开始统计的时刻执行:**stat startfile
**在统计完成的时刻执行:**stat stopfile

猜你喜欢

转载自blog.csdn.net/qq_41841073/article/details/129413917