I can’t get Motion Blur to work with SceneCapture2D. I create the SceneCapture2D in C++ and set some extreme values just to see the effect more easily.
ASceneCapture2D* pPinhole2D = pWorld->SpawnActor();
pPinhole2D->Rename( *actorName );
pPinhole2D->SetActorLabel( *actorName );
pPinhole2D->SetActorRelativeRotation( swapMatrix.Rotator() );
pPinhole2D->SetActorRelativeLocation( translation );
pPinhole2D->GetCaptureComponent2D()->PostProcessSettings.bOverride_MotionBlurAmount = true;
pPinhole2D->GetCaptureComponent2D()->PostProcessSettings.MotionBlurAmount = 50.0f;
pPinhole2D->GetCaptureComponent2D()->PostProcessSettings.bOverride_MotionBlurMax = true;
pPinhole2D->GetCaptureComponent2D()->PostProcessSettings.MotionBlurMax = 500.0f;
But there is no effect. What more is there that I need to set it up? Do I need a PostProcessVolume, and does that then have to be connected in some way to the SceneCapture2D? I have a volume in the scene, but it appears to do no good at all. Does the SceneCapture2D have to be connected to the camera in some way?
Here is the code for the Render Target texture if that helps:
UTextureRenderTarget2D* pFTexture = (UTextureRenderTarget2D*)
NewObject<UTextureRenderTarget2D>( pWorld->GetOuter(), UTextureRenderTarget2D::StaticClass() );
pFTexture->ClearColor = FLinearColor::Black;
pFTexture->bHDR = 1;
pFTexture->Rename( *textureName );
pFTexture->InitAutoFormat( SizeX, SizeY );
pPinhole2D->SetActorTickEnabled( false );
pPinhole2D->GetCaptureComponent2D()->FOVAngle = 90.0;
pPinhole2D->GetCaptureComponent2D()->TextureTarget = pFTexture;
pPinhole2D->AttachToActor( vehicleActor, FAttachmentTransformRules( EAttachmentRule::KeepRelative, true ) );
RenderTargets[i] = pFTexture;
How does one set this up?
I have now created a new standard code project in Unreal with some starter contet (the scene with two chairs and a table). I created my own Actor C++ class and added code in the Tick function that makes it go up and down on a loop. I then added this actor to the scene and attached a SceneCapture2D to it and assigned a Render Target texture to it. But I can’t get motion blur so show up in the rendered texture. I’ve enabled motion blur in the project settings, on the SceneCapture2D itself, I added a PostProcessVolume to the scene, but nothing works, there is no difference what so ever! Is the some secret magic trick you need to do or special setup? I’ve parented the PPV to the SC2D and vise versa but that makes no difference, I’ve tried Unbound set to both true and false with no effect. Nothing happens, there is no motion blur what so ever. If I move the editor camera around I get lots of motion blur though, so it is working but not for SceneCapture2D. I’ve googled all I can but the only post that shows up is that people seems to have the opposite problem, that they get to much motion blur in their SceneCapture2D?!
Does motion blur happen over several frames? If so, it won’t show up in a single scene capture frame. The same would hold true for temporal AA.
I don’t know, how do I check if it happens over several frames, and how do I change it if it is so?
Did anyone solve this issue? I’m stuck on the same problem.
My workaround at the moment is to use additive scene captures and then to lower the brightness manually in material. However, with really fast moving objects or rotating the camera instead of a smooth blur I get a stuttered effect due to not having enough frames to capture. Another problem is that is additive scene capture only works with SceneColor, and not with final Color, which means I am unable to capture the scene with Post-processing.
To deal with the lack of frames I spawn instances of meshes along their path of movement, however this is not very performant and also only works for moving static meshes and Skeletal Meshes. It doesn’t work for particles and also doesn’t work help when you move the camera.
Ideally I’d like to be able to capture motion blur in an additive scene capture. Has anyone had any luck or is this impossible in Unreal’s rendering pipeline?
Here’s a video which illustrates the problem. The render capture is in the bottom left frame. Scene Capture No Motion Blur Demo - YouTube
These are the capture settings I am using (Ideally I would like a solution which enables me to “additively” blend the targets rather than overwrite them
