-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Fix radiance for sky in GLES stereo rendering #86018
Fix radiance for sky in GLES stereo rendering #86018
Conversation
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.
Great catch! The code changes look good to me, but probably should be reviewed by someone who knows rendering a little better than me :-)
16ceb91
to
e06ac4d
Compare
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 great!
Thanks! |
Cherry-picked for 4.2.2. |
Can't be cherry-picked for 4.1 because it depends on changes from #77496. |
This took me waaaaaaaaaaaaaaaaaaaaaaay too long to figure out.
In OpenGL everything is output upside down compared to Vulkan, that means that our culling order is reversed, see
in
RasterizerSceneGLES3::render_scene
.However, when we output to OpenXR (or webXR), the compositor expects us to deliver images with the same orientation and thus we change things up and render things "upside down", and only flip the image on output to screen. So we keep to the same culling order.
The problem then is that our sky radiance map update code runs after we do this optional flip. This logic renders a full screen triangle to perform a full screen effect. The order of the vertices of this triangle is defined on the assumption we are doing our flip.
In normal mode, we render our triangle and thus our radiance map is rendered.
In XR mode we cull our triangle and thus our radiance map remains black.
The simple answer is to disable culling as we don't care for culling in this case.
This PR cleans up a few related issues and code that assumes state is retained when it's not.
Fixes #84598