Search Unity

Access to backbuffer in Stereoscopic mode

Discussion in 'Immediate Mode GUI (IMGUI)' started by Gusi, Apr 21, 2015.

  1. Gusi

    Gusi

    Joined:
    Apr 21, 2015
    Posts:
    1
    Hi,
    I'm writing a native plugin that modifies the content of the backbuffer. When using stereoscopic mode in the unity 5, internally the player uses two ID3D11RenderTargetViews, one for each eye.

    My code is based on the Native Plugin sample at Unity documentation, so I'm calling my plugin render method after WaitForEndOfFrame.

    This is working rigth in non-stereoscopic mode, but in stereo, the current active backbuffer (ID3D11RenderTargetView) is the one belonging to the left eye, and I can't find a way to change to the right eye one to do the required drawing.

    I've also tried to hook to some of the exposed camera events trying to find the pointers to the backbuffer textures, but I can't find any of them firing for each eye.

    So, there is a known solution for this? Maybe in a future version it could be possible to access rendertargets for each eye from unity script so it's possible to access them from the native plugin after the render is done?

    Thanks in advance.