I’m using several USceneCaptureComponent2Ds throughout my project as in-environment cameras to render things other than the main game window.
However, when I set the graphics quality of the project to “Medium” or “High” at the command line, these capture components seemingly don’t produce any output at all -- the render targets are all black.
This is extra perplexing because I do get an image if the quality is “Low” (which means this isn’t just a linear scaling effect). I believe I also see images at every scalability setting when I run the Editor; the black images only show up with a built Game.
Here are the settings I’ve got for both the capture components and their associated render targets. Is there anything here that would indicate why things don’t work with those two scalability settings in particular? And, crucially, is there a way I can restore rendering behavior at “Medium” and “High” scalability?
RenderTarget->bForceLinearGamma = ForceLinearGamma;
RenderTarget->RenderTargetFormat = ETextureRenderTargetFormat::RTF_RGBA8;
RenderTarget->OverrideFormat = EPixelFormat::PF_B8G8R8A8;
RenderTarget->TargetGamma = FMath::Max(0.0f, GammaCorrection);
SensorRenderTarget->UpdateResourceImmediate(true);
RenderTarget->InitCustomFormat(ImageSizeX, ImageSizeY, EPixelFormat::PF_B8G8R8A8, ForceLinearGamma);
CaptureComponent->Deactivate();
CaptureComponent->CaptureSource = ESceneCaptureSource::SCS_FinalColorLDR;
CaptureComponent->FOVAngle = HorizontalFOV;
CaptureComponent->TextureTarget = SensorRenderTarget;
CaptureComponent->UpdateContent();
CaptureComponent->ShowFlags.SetTemporalAA(true);
CaptureComponent->FOVAngle = HorizontalFOV;
CaptureComponent->TextureTarget = RenderTarget;
[Attachment Removed]
Hello,
Thank you for reaching out.
I’ve been assigned this issue, and we will be looking into these blank scenecaptures for you.
Can you please send us a minimal test project that demonstrates this, and include your buildcookrun and launch commands?
The guide for test projects:
[Content removed]
[Attachment Removed]
Hi Stephen -
Unfortunately I cannot easily share our project due to intellectual property considerations and it will take me some time to assemble a stripped-down reproducible example. However, our buildcookrun command looks like this:
call "%BATCH_DIRECTORY%\RunUAT.bat" BuildCookRun -project="%WORKING_DIRECTORY%\%SHIPPING_PROJECT_NAME%\%SHIPPING_PROJECT_NAME%.uproject"^
-build^
-clientconfig=Development^
-cmdline=" -Messaging"^
-compressed^
-cook^
-createreleaseversion="1.0"^
-installed^
-noP4^
-nocompile^
-nocompileeditor^
-pak^
-platform=Win64^
-prereqs^
-serverconfig=Development^
-stage^
-stagingdirectory="%STAGING_DIRECTORY%\Shipping"^
-targetplatform=Win64^
-unattended^
-unversionedcookedcontent^
-utf8output
and our launch command (on Windows, for Medium scalability) looks like this:
VehicleSimulation.exe /Game/Maps/USCityBlock?game=/MathWorksSimulation/Blueprints/Sim3dViewerGameMode.Sim3dViewerGameMode_C -ExecCmds="r.DefaultFeature.MotionBlur 0,r.Vulkan.EnableDefrag 0,r.SetNearClipPlane 1,Scalability 1" -pakdir="C:\Users\me\Paks" -SaveToUserDir &
[Attachment Removed]
Hi Stephen -
Unfortunately I cannot easily share our project due to intellectual property considerations and it will take me some time to assemble a stripped-down reproducible example. However, our buildcookrun command looks like this:
call "%BATCH_DIRECTORY%\RunUAT.bat" BuildCookRun -project="%WORKING_DIRECTORY%\%SHIPPING_PROJECT_NAME%\%SHIPPING_PROJECT_NAME%.uproject"^
-build^
-clientconfig=Development^
-cmdline=" -Messaging"^
-compressed^
-cook^
-createreleaseversion="1.0"^
-installed^
-noP4^
-nocompile^
-nocompileeditor^
-pak^
-platform=Win64^
-prereqs^
-serverconfig=Development^
-stage^
-stagingdirectory="%STAGING_DIRECTORY%\Shipping"^
-targetplatform=Win64^
-unattended^
-unversionedcookedcontent^
-utf8output
and our launch command (on Windows, for Medium scalability) looks like this:
VehicleSimulation.exe /Game/Maps/USCityBlock?game=/MathWorksSimulation/Blueprints/Sim3dViewerGameMode.Sim3dViewerGameMode_C -ExecCmds="r.DefaultFeature.MotionBlur 0,r.Vulkan.EnableDefrag 0,r.SetNearClipPlane 1,Scalability 1" -pakdir="C:\Users\me\Paks" -SaveToUserDir &
[Attachment Removed]
Hello,
We have been unable to reproduce the behavior you are seeing, where the Scene Captures do not capture the scene on Medium and High scalability.
We understand it might take time to build a minimal test project that reproduces this issue, but we do need that to investigate the behavior. It is also possible you might find the cause by making such a test project.
[Attachment Removed]
I think I figured this out -- it looks like there was a re-configuration of the capture component way up in our class hierarchy that set
CaptureComponent->DetailMode = EDetailMode::DM_High;When I remove this, I get images at all qualities. This is still a little perplexing, though, because I would expect this setting to block images at quality levels less than High, but I did see rendered graphics when the quality was Low.
[Attachment Removed]
Hello,
The function responsible for culling captures is “USceneCaptureComponent::IsCulledByDetailMode()” from SceneCaptureComponent.cpp.
In general, detail mode allows components below the global detail mode (“r.DetailMode”) and culls components that are higher.
Please let us know if this helps.
[Attachment Removed]