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

Check that reflections are correct when rendering in stereo #49

Closed
Cameron-Micka opened this issue Jul 6, 2022 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@Cameron-Micka
Copy link
Member

Original issue: microsoft/MixedRealityToolkit-Unity#8207

Describe the bug

a PBR material using the MRTK Standard Shader with reflections enabled feels right in the Unity Editor (2019.4.4f)
looking throught the Oculus Quest headset however shows that the reflections are being rendered from the same origin point for both eyes. This results in having no depth to the reflection and it looks really weird and wrong.

When previewing using Oculus Link (so running from the PC) the depth does look correct so it's something introduced when building the shaders for mobile (android).

To reproduce

Steps to reproduce the behavior:

Create a VR project for Oculus Quest using Unity 2019.4.4f, Single pass, forward rendering, NO URP
Create a highly reflective MRTK Standard Shader material with or without a channel map.
Create a scene where you have something to reflect of and attach the material.
Build for the Quest and run on device.
Move around the scene and look at the reflection. It feels like something is moving on top of the material instead of a clear reflection both eyes are seeing the same reflecting image and the illusion of reflection is gone. Close one eye and move sideways and you'll see the reflections feels okay again.

Expected behavior

a reflection that looks different for each eye

Screenshots

Very hard to take a screenshot explaining the problem as the quest only allows me to screenshot one eye.

Your setup (please complete the following information)

  • Unity 2019.4.4f
  • Single pass, forward rendering, Standard Rendering Path, No URP.
  • MRTK Version 2.3.0
  • Oculus Utilities

Target platform (please complete the following information)

  • Oculus Quest VR SDK
  • Android

Additional context

Fixed it by adding this to the shader:
Starting on line 987:

#if defined(_NORMAL) || defined(_REFLECTIONS) || defined(_ENVIRONMENT_COLORING)
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
#endif

@Cameron-Micka Cameron-Micka added the bug Something isn't working label Jul 6, 2022
@pinkwerks
Copy link
Collaborator

This does not reproduce with Unity 2020.3.42. Reflection appears stereoscopic in both built APK and quest link. Feel free to close @Cameron-Micka

@Cameron-Micka
Copy link
Member Author

Thank you so much for verifying this @pinkwerks! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants