Within our application, we can define the viewport layout and are rendering views considering external parameters. We are managing this as player split screens.
The rendering seems to occur correctly but the presentation is, as far as I can tell, not done correctly.
I found a couple case (including one from our team which seems close but not exactly the same):
[Content removed]
[Content removed]
In details :
In the below shot, we expect the rendering to cover half (0.5) the viewport in both x and y directions and start at a quarter in x and origin in y.
We are looking straight to an entity:
[Image Removed]
We can see that the scene is rendering but is not presented at the desired location leading to the first half be clipped by the presentation rectangle.
IF I enable temporal antialising :
[Image Removed]
THEN, presentation in correct :
[Image Removed]
We are defining presentation areas using the viewport method as an override from the GameViewPortClient ( virtual void LayoutPlayers() override; ) in a similar way. Should not matter since the viewport is correctly considered.
I wasn’t able to reproduce this error in latest using traditional split screen and by modifying UGameViewportClient::UGameViewportClient so that the first splitscreen layout was the offset one:
After entering splitscreen mode I tried toggling r.AntiAliasingMethod and various screen percentages to try and emulate the behavior you are seeing but the viewrect was unaffected.
It’s possible this was an issue was fixed, or that I’m not reproducing the issue in the same way somehow, possibly you are using some kind of upscale or dynamic resolution settings I don’t have. I’m in the process of trying to reproduce in 5.6, but if you cannot easily provide a sample project that reproduces the issue in vanilla UE, I recommend logging the following per-view before PostProcessing:
View.ViewRect
View.UnscaledViewRect
View.GetSecondaryViewRectSize()
View.GetSecondaryViewCropRect()
View.Family->SecondaryViewFraction
View.PrimaryScreenPercentageMethod
ViewFamilyTexture->Desc.Extent
Also take RenderDoc captures or DumpGPU with r.AntiAliasingMethod 0 and 1 and compare the upscaling passes to see if the render-target viewport in the upscaling or tonemap passes are different.
I went ahead and generated GPU dumps as suggested and it seems the rendering is not placed in the same location of the viewfamilytexture according to the anti aliasing method:
[Image Removed]
I am attaching as well the dumps.
I am not certain of the expected workflow but I guess the issue comes from the copy from tone map into the view family texture does not account for the offset.
Let me know if this is enough for you to investigate ?
Note I will be travelling next week and have limited response capabilities.
The AA GPU dump uses r.AntiAliasingMethod=1 and the NoAA GPU dump uses r.AntiAliasingMethod=2, is the error occuring for you only when using TAA ( r.AntiAliasingMethod=2) or only when using no AA (r.AntiAliasingMethod=0)?
[Image Removed]We’ll need a RenderDoc capture with r.AntiAliasingMethod 0 to verify the pass causing the error, the relevant code in LayoutPlayers() or ideally a sample project in vanilla UE that shows the issue.
I am uploading renderdocs captures for antialiasing methods 0, 1 and 2.
I hope this can help. I had a quick look and both scissors and viewport seem correct to me !
From your screen shot, the difference I can think of is that you probably have multi players. While we are using player layout to define / restrict the desired area, we have a single player in the game.
Unfortunately, I’ve been unable to reproduce the issue using the code posted above in vanilla UE 5.6. Is it possible you have other engine changes? There may also be other project-specific render settings affecting this too, but I’ve tried to match what you have as best I can without success. Somehow the ToneMap and CopyTexture RSSetViewports in your case is using 0,0 for the origin instead of the offset calculated with Player->Origin.
If you can find a way to attach a vanilla UE project that reproduces this issue with the same settings and minimal code you are using that will make it much easier to debug.
With regards to Engine changes, we were hoping to stick to a vanilla version. Still, we reached a point where we had to add performance traces (cpu scopes to understand bottlenecks), and backported two bug fixes (a stability one in the renderer and a performance one in the garbage collector). Nothing that could (well should) be leading to such an anomaly. Also, I had the issue within vanilla UE 5.8.1.
I am still to try in 5.8.2 but I expect the same results.
I talked with another person on our side and while we have a couple extensions, none should be interacting with AA and this.
We will find a test case that can be brought into the engine. Maybe we will find the trigger on the road to it.
I have my hands tied with a performance issue at the moment but I will get back to this as soon as I have a chance.
It appears that enabling an optimization on my side (disabling an extension when it is not required), it actually hides the problem. Speaking again with the developer from this extension, he remembered this support case :
[Content removed]
The extension in question is triggering a compute shader and all code path are returning the untouched flag:
Unfortunately, subscribing to a different pass as initially accepted is not an option (incorrect color space for our histogram, …) and this time, playing with the showflags as workaround is not helping.
I hope this will be enough for you to reproduce this time.
Yes, this should be fine after packaging also. If this issue is now resolved, I’ll go ahead and close it and the Jira above can be used for tracking the engine-side fix. Let me know if you have any additional questions.