Buffer Visualization in Executable build of my project

What console commands can I use in my executable to show various buffer visualizations? For example I want to show AO only, or albedo or specular (on the whole scene).

So similar to this screenshot right here:
https://docs.unrealengine.com/latest/images/Engine/UI/LevelEditor/Viewports/ViewModes/Buffer_Overview.jpg

But in the actual executable build of my project instead of the editor.

‘show visualizebuffer’ together with ‘r.BufferVisualizationTarget x’, where x is one of the strings in the [Engine.BufferVisualizationMaterials] section of BaseEngine.ini

[Engine.BufferVisualizationMaterials]
BaseColor=(Material=“/Engine/BufferVisualization/BaseColor.BaseColor”, Name=LOCTEXT(“BaseColorMat”, “Base Color”))
CustomDepth=(Material=“/Engine/BufferVisualization/CustomDepth.CustomDepth”, Name=LOCTEXT(“BaseCustomDepthMat”, “Custom Depth”))
DecalMask=(Material=“/Engine/BufferVisualization/DecalMask.DecalMask”, Name=LOCTEXT(“BaseDecalMaskMat”, “Decal Mask”))
FinalImage=(Material=“/Engine/BufferVisualization/FinalImage.FinalImage”, Name=LOCTEXT(“BaseFinalImageMat”, “Final Image”))
ShadingModel=(Material=“/Engine/BufferVisualization/LightingModel.LightingModel”, Name=LOCTEXT(“BaseShadingModelMat”, “Shading Model”))
MaterialAO=(Material=“/Engine/BufferVisualization/MaterialAO.MaterialAO”, Name=LOCTEXT(“BaseMaterialAOMat”, “Material Ambient Occlusion”))
Metallic=(Material=“/Engine/BufferVisualization/Metallic.Metallic”, Name=LOCTEXT(“BaseMetallicMat”, “Metallic”))
Opacity=(Material=“/Engine/BufferVisualization/Opacity.Opacity”, Name=LOCTEXT(“BaseOpacityMat”, “Opacity”))
Roughness=(Material=“/Engine/BufferVisualization/Roughness.Roughness”, Name=LOCTEXT(“BaseRoughnessMat”, “Roughness”))
SceneColor=(Material=“/Engine/BufferVisualization/SceneColor.SceneColor”, Name=LOCTEXT(“BaseSceneColorMat”, “Scene Color”))
SceneDepth=(Material=“/Engine/BufferVisualization/SceneDepth.SceneDepth”, Name=LOCTEXT(“BaseSceneDepthMat”, “Scene Depth”))
SeparateTranslucencyRGB=(Material=“/Engine/BufferVisualization/SeparateTranslucencyRGB.SeparateTranslucencyRGB”, Name=LOCTEXT(“BaseSeparateTranslucencyRGBMat”, “Separate Translucency RGB”))
SeparateTranslucencyA=(Material=“/Engine/BufferVisualization/SeparateTranslucencyA.SeparateTranslucencyA”, Name=LOCTEXT(“BaseSeparateTranslucencyAMat”, “Separate Translucency Alpha”))
Specular=(Material=“/Engine/BufferVisualization/Specular.Specular”, Name=LOCTEXT(“BaseSpecularMat”, “Specular”))
SubsurfaceColor=(Material=“/Engine/BufferVisualization/SubsurfaceColor.SubsurfaceColor”, Name=LOCTEXT(“BaseSubsurfaceColorMat”, “Subsurface Color”))
WorldNormal=(Material=“/Engine/BufferVisualization/WorldNormal.WorldNormal”, Name=LOCTEXT(“BaseWorldNormalMat”, “World Normal”))
AmbientOcclusion=(Material=“/Engine/BufferVisualization/AmbientOcclusion.AmbientOcclusion”, Name=LOCTEXT(“BaseAmbientOcclusionMat”, “Ambient Occlusion”))
CustomDepthWorldUnits=(Material=“/Engine/BufferVisualization/CustomDepthWorldUnits.CustomDepthWorldUnits”, Name=LOCTEXT(“BaseCustomDepthWorldUnitsMat”, “Custom Depth World Units”))
SceneDepthWorldUnits=(Material=“/Engine/BufferVisualization/SceneDepthWorldUnits.SceneDepthWorldUnits”, Name=LOCTEXT(“BaseSceneDepthWorldUnitsMat”, “Scene Depth World Units”))

1 Like

Hi , ShowFlag.Visualizebuffer and r.BufferVisualizationTarget are actually only visible inside the editor, and I failed to get the latter working at all.
So is there something I need to do to enable these console commands in the packaged game? and could you give an example for using the r.BufferVisualizationTarget command?
Thanks

If you build a development version of the game and not a shipping version, you should be able to see the buffers. Shipping takes most of this stuff out.

I’m indeed building a development version, and I’m able to view and use the console in the packaged game, however those two commands in particular are missing from my development build.

Hello ,

As Hany mentioned, the two commands you mentioned ShowFlag.Visualizebuffer and r.BufferVisualizationTarget are missing from development builds.

Could you please give an example for using the r.BufferVisualizationTarget command?

I only tested the commands with UE4Editor.exe -game (editor executable run in game mode). I’m guessing they don’t work in cooked game because they are tagged as cheat cvars. You can test removing the cheat flag and compile the game executable, see if they work then.

void FBufferVisualizationData::ConfigureConsoleCommand()

IConsoleManager::Get().RegisterConsoleVariable(
GetVisualizationTargetConsoleCommandName(),
TEXT(“”),
*ConsoleDocumentationVisualizationMode,
ECVF_Cheat);

In addition to enabling the commands, I think you need two things:

  • r.ForceDebugViewModes=1 (DefaultEngine.ini). Otherwise FSceneView::ConfigureBufferVisualizationSettings() is not being called.
  • After setting that variable, you need to recook your content, which will now include Engine/Content/BufferVisualization/*.uasset. Otherwise FBufferVisualizationData::Initialize() won’t find the visualization materials.

You can use Post Process Material found in the engine content and apply the one you want to the post process volume. You can also create a reference of post process volume and control it through blueprint.

Thanks,

I want to use “ForceDebugViewModes” in AndroidEngine.ini ,but there was no response.So what should i do?

I added the line as the first thing in defaultengine.ini, deleted all folders in the project except for content and config, and then restarted the editor and packaged the project and STILL it tells me it’s not allowed.

What did I miss?

EDIT: Ok, so you need to put the line after the RenderSettings line… BUT:

When I type “viewmode wireframe” everything disappears, even colliders that were previously showing using “show collision”. What’s up with that?