-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip 2D rendering if stereo enabled and fix couple of MSAA issues #83649
Conversation
With the fixes this now introduces, I suggest we merge this as a bugfix. |
c6993c4
to
bd18f9d
Compare
eb4cdcb
to
e4cdcc6
Compare
e4cdcc6
to
acf6337
Compare
acf6337
to
c5c417a
Compare
c5c417a
to
e1211a0
Compare
e1211a0
to
425e943
Compare
bool scaling_3d_is_fsr = (scaling_3d_mode == RS::VIEWPORT_SCALING_3D_MODE_FSR) || (scaling_3d_mode == RS::VIEWPORT_SCALING_3D_MODE_FSR2); | ||
bool use_taa = p_viewport->use_taa; | ||
|
||
if (scaling_3d_is_fsr && (scaling_3d_scale > 1.0)) { | ||
if (scaling_3d_is_fsr && (scaling_3d_scale >= (1.0 + EPSILON))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requested by @DarioSamo to change this. Not sure if this should be >
or >=
Does this preserve the 2d controls on a 3d plane usecase for vr? |
No, this purely stops 2D rendering on the viewport that has Rendering 2D content to other viewports which are then displayed on 3D quadmeshes etc. works as before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly fine to me. There were a few changes that I am unsure about as the reason for the change is not obvious. So I left a few comments asking for clarification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. I am a little wary about the extra copy when using MSAA, but since FSR can only be used on desktop anyway, it isn't a huge deal for now. At some point we will want to return and see if we can't eliminate that copy though.
Agreed, it's a bit of an unlikely scenario but I'm sure there is a way to have FSR output into an MSAA buffer. |
Thanks! |
Looks like this change led to some regressions and potentially uncovered other issues. I'd avoid cherry-picking it based on this, especially given that it's not clear how critical the fixes are for 4.1 and if we may find more issues in future. I'll remove the label, but if the rendering team still wants this, keep in mind that we also need to pick #84267. |
Small fix in the viewport logic, when we enable stereoscopic rendering we can't render 2D elements as these lack depth information.
The assumption up till now was that users simply wouldn't add 2D elements to the scene but this has lead to a couple of issues:
This fix ensures that 2D is disabled when stereoscopic rendering is applied to a viewport.
Note, it isn't enough to check use_xr, for phone AR (ARKit/ARCore) 2D elements can be used.
edit In testing this fix I ran into issues with MSAA2D which had to be dealt with, that threw me down a rabbit hole that ended up fixing a number of MSAA related issues.
second edit turned out when introducing FSR2 we lost some the logic that turns scaling off when scaling is set to 1.0 and introduce overhead both when FSR1 was set or when running on the mobile renderer.
Added a change that re-instates the old logic, but leaves the option to set scaling to 1.0 with FSR2.
Dumb little test project to test the MSAA settings, run with both Mobile and Forward+ to test:
Test MSAA.zip