Skip to content
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

Make MSAA in GLES2 work with external textures for VR #33444

Merged
merged 2 commits into from
Nov 8, 2019

Conversation

BastiaanOlij
Copy link
Contributor

@BastiaanOlij BastiaanOlij commented Nov 8, 2019

This PR undoes @NeoSpark314 s change and changes the MSAA logic so the scene gets rendered into Godots properly setup MSAA buffers and then does the MSAA resolve into the external texture instead of the normal forward buffer. This means MSAA now works on all platforms including desktop.

This is not all sunshine and daisies though. While this does correctly implement the MSAA logic as intended by Godot it removes an important optimisation for the Quest.

The ideal situation for the Quest is for the external texture to be a properly set up MSAA render target and for the _post_process to be skipped completely. The MSAA resolve will happen when the Oculus SDK applies the lens distortion shader to render the final output.

It is my opinion that should be a project in its own right and instead of using Godots MSAA logic, to turn off MSAA in Godot and instead have the plugin drive this fully. This does mean that the plugin needs to be aware whether the GLES2, GLES3 or Vulkan driver is active and some how inform Godot of the fact that a MSAA capable depth buffer is needed for the external fbo. Alternatively one options that was suggested is to have the plugin setup the FBO completely and just provide an FBO to Godot instead of a texture id (or a struct with all info as the texture id may still be needed).

Bugsquad edit: Reverts and supersedes #33291, fixes #33188.

@akien-mga akien-mga merged commit 28294b1 into godotengine:master Nov 8, 2019
@akien-mga
Copy link
Member

Thanks!

NeoSpark314 added a commit to NeoSpark314/godot that referenced this pull request Nov 9, 2019
This change avoids any post processing in the case an external texture
is used and it also renders directly to the provided external texture.
This addresses GodotVR/godot_oculus_mobile#70
and ignores the changes in godotengine#33444
for the android case.
@BastiaanOlij BastiaanOlij deleted the external_msaa branch February 27, 2020 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Oculus Mobile VR (Android) MSAA with GLES2 not working
3 participants