Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Single Pass Stereo Rendering on Android

Discussion in 'AR/VR (XR) Discussion' started by GuyTidhar, Jun 7, 2017.

  1. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    Hi guys,

    We want to implement Single Pass Stereo Rendering on an Android device. Is this something we could create with strictly shaders or does it require Unity engine changes?
    Does the Android GPU need to support specific features to support this?

    Thanks!
     
    Last edited: Jun 8, 2017
  2. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,091
  3. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    Thanks, but I am referring not to the use of Single Pass Stereo rendering but the implementation. When you say "The device has to support..." are you referring to support by Unity or support in hardware/OS level? I know Unity does not support Android yet.
    I am asking if we would be able to implement the feature by our selves for a certain Android device.

    I've updated my initial question to make it more clear.
     
    RageAgainstThePixel likes this.
  4. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,091
    As the editor refers to it, it seems to be depending on the android device. (not sure if this is a hardware or OS level)
    This is the warning/information point:

    Android Single pass Stereo.png

    If it wouldn't support single pass stereo on android yet, why would you even start to ask about this?
    Kind of doesn't make sense.

    Unity 5.6 supports this, hence the manual
    if you've read the manual it says
    So the standard shader should already support single pass stereo.

    if you do have custom shaders and require them to be single pass stereo compatible you have to modify them.
    They've already documented that in the manual I linked before.

    Besides setting the stereo rendering method and using shaders that are single pass stereo compatible theres nothing else you have to do in order to get the feature to do its job.
     
  5. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    Because the only thing you can know for sure from the message you've screenshot is that in Unity their is currently no support for SPSR on Android devices in general. SPSR is not Unity's idea - they've implemented a known Technic. "Android Devices" - does not mean that all Android devices out there or planned Android devices do not support the technology.
    Basically I am trying to figure out whether the implementation of the technology on a certain Android (we're using a certain one) needs the support of the Android OS and Hardware.

    Again, I am not referring for the use of SPSR, but for the implementation of SPSR for Android.

    I know Unity does not support this yet and I want to know what it means to do it ourselves at this current state.

    Makes more sense?
     
    ryogo_yamasaki likes this.
  6. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    RageAgainstThePixel likes this.
  7. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,091
    The standard shader should support both single stereo pass and multi stereo pass rendering.
    When the SDK is set to none, that would be equal to normal use of the shader, it has nothing to do with single or multi stereo rendering as it is mono rendering.

    As described in the link SPSR should be supported
     
  8. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    That doesn't actually makes sense. Can you direct me or explain how did you come to this conclusion? I am not referring to a use of no SDK, but adding the "None" SDK for VR which suggests it probably does do stereo rendering and not mono but just not using a specific SDK for device integration. So it kind of does suggests the shaders will support this.
     
  9. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,091
    The "None" is not using stereo rendering at all. An SDK gives the functionality to render in stereo.
    When "None" is selected that would be equal to having virtual reality support off.

    The "None" is used in cases where a developer can support both Non-VR and VR modes but start with no SDK active.
    When no SDK is used, it is just normal monoscopic rendering (single big screen, not split). Once you want to start the VR mode, you use VRSettings.LoadDeviceByName("sdk name") -> wait one frame -> VRSettings.enabled = true
    and then if you want to exit VR just simply set VRSettings.enabled to false.
    https://docs.unity3d.com/ScriptReference/VR.VRSettings.LoadDeviceByName.html

    maybe a better explaination would be:
    having "None" as 1st SDK in de list so that you can show a 2D menu on the phone.
    Once the end-user clicks play, you load up the VR device using LoadDeviceByName, wait a frame and then set the VR enabled to true.
    When the user is done playing and returns to the menu you turn VR Enabled to false.

    hope that makes sense



    [Edit]
    https://docs.unity3d.com/Manual/VROverview.html
     
    Last edited: Jun 8, 2017
  10. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    @MaskedMouse thanks for this info man - really helpful.

    I'm basically asking this because we don't want to use any of the currently supported SDKs by Unity.
     
    RageAgainstThePixel likes this.
  11. Seraphic572

    Seraphic572

    Joined:
    Mar 11, 2016
    Posts:
    21
    Can we use single pass stereo rendering with android devices ? While using unity 5.6 version
     
  12. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    You can use it if you have VR mode set and one of the VR SDKs set, as long as the android devices running the app supports it. Of course it needs Unity 5.6 and make sure you select that checkbox.
    It is also currently only supported in OpenGL as the Vulkan API does not yet support this. Though as far as I know, Vulkan without SPSR performance gains are actually higher then OpenGL with SPSR.
     
    ryogo_yamasaki and Seraphic572 like this.
  13. catox

    catox

    Joined:
    Dec 19, 2014
    Posts:
    15
    I have done this by a very tricky way, hope it could give you a hint.
    https://github.com/liushijian2ideal/RenderTexture2DArray
     
  14. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    RageAgainstThePixel likes this.
  15. RageAgainstThePixel

    RageAgainstThePixel

    Joined:
    Mar 11, 2020
    Posts:
    66

    This was the most helpful thing I've found on this topic. Anything more recent we can use now that the tech is a bit more mature?
     
  16. hass321

    hass321

    Joined:
    Apr 22, 2022
    Posts:
    1
    Could you tell me why the application appears on the cell phone screen in single pass mode in a small way. how could I leave it in the normal screen size or at least bigger?