I’m fairly sure that this commit was meant to fix Temporal AA and Motion Blur in Scene Capture 2D’s, but I can’t seem to get it to work. I’ve tried a variety of Render Target formats with no success.
The fact don’t see the render target of your scene capture being double tonemapped makes me suggest you have forgotten to set the capture source to final color on the scene capture, required to run the post processing chain of the renderer that includes passes such as motion blur or temporal aa. Would I be correct by any chance?
Does that mean it’s only possible to use this with Scene Color LDR? That would be a real shame if so
LDR is a just a terrible name sadly a legacy frozen in assets that slow us down to refactor this.
You can have this work: scene capture source to final color, enable all post processing pass such as MB and TAA you need with show flags. and add a post process material that replace the tonemapper (material’s blendable location = replace tonemapper) that just do the additive blend of bloom and scene color (don’t forget the bloom intensity). The additive bloom is available in this blendable location in postprocessinput2.
This way your scene capture’s rendertarget will still be in linear color space, but with all the post processing enabled, that I believe is what you are looking for.
I see in your code you disable every frame automatic update of the scene capture. To have TAA and MB, among other graphic feature, you will need to set bAlwaysPersistRenderingState=true;
Thanks @Guillaume.Abadie - I’ll try and set this up and get back to you!
The reason I disabled Capture Every Frame is because I manually capture the scene in another function, only when split-screen mode is active and when camera positions have been finalised - would it be better for me to use Capture Every Frame, and just turn that bool on and off instead of calling CaptureSceneDeferred() manually?
Also what texture settings for the Render Target should I be using? I currently have it set to not be HDR and using Linear Gamma.
You most likely want float RT for your linear color space output that may have arbitrary lighting intensity.
As long as you have bAlwaysPersistRenderingState==true when bCaptureEveryFrame==false, it won’t have any difference.
When resuming capturing frames of a scene capture at a given frame N, I would like to remember you should manually emit a camera cut on the scene capture with USceneCaptureComponent2D::bCameraCutThisFrame on that very frame N. Otherwise the result of TAA for frame M>=N may have artifacts until it recovers from this crippling case. This is by design because the motion vector of your opaque geometry within the frame are going to indicate wrong previous location.
In the example project above, the capture source is set to ‘Scene Color (HDR)’, since that’s the only way to make the Render Target look identical to the Scene around it (other settings make it look darker, lighter etc so aren’t that useful).
Does that mean it’s only possible to use this with Scene Color LDR? That would be a real shame if so
Note, I’ve also tried Final Color - and while this does work, the material looks a LOT darker
I want to use this feature to create a split-screen system by using the Render Target as the second half of the screen, but since TAA doesn’t work this doesn’t seem to be possible
I can increase the Render Target brightness by messing with ‘Target Gamma’, but something about that doesn’t feel right…
And this is the result I get. The problem now is that the Bloom in PostProcessInput 2 is NOT anti-aliased so looks very blocky, so I’m having trouble adding it back to the scene view:
I seem to have been able to Match the Render Target output with the Scene output now when using ‘Replace Tonemapper’. To do this, you also need to do this on the Scene Capture:
VoronoiCapture->ShowFlags.SetTonemapper(false);
However, now I have no bloom input for the Render Target, realistically I need ALL post processing to be done on the Render Target right? Then match the scene up to it?
This is what it looks like using ‘Replace Tonemapper’, and with the Scene Capture Tonemapper switched off. Everything matches - but now I have no post-processing
To achieve large bloom radius, Bloom works by down and upsampling scene color. This thing can happen. according to the content. And I just trust all your content after the Add of the scene color and bloom is not enhancing this problem.
You are missing multiplying the bloom input by the bloom intensity btw.
@Guillaume.Abadie This seems to be as close as I can get. I set the Material to ‘Before Tonemapping’ - then turn the Tonemapper OFF for the Scene Capture.
This gives me Post-Processing for both sides without any blocky artefacts in bloom and all the good stuff etc… Unfortuantely however, the Render Target is now quite blurry when in motion. See here. It’s so close now!
You would think that Setting the Material to ‘After Tonemapper’ and calling 'SetTonemapper(true) would make the Render Target come out the same as the Scene, but it doesn’t