Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
whitehexagon's avatar
whitehexagon
Explorer
11 years ago

Mirror Texture prior to distortion effects?

I'm creating the mirror texture to display on the desktop, but it has all the distortion effects applied... is there a way the SDK can provide this texture without the distortion effects? For example a red triangle down in the corner of the display gets badly color separated. So I'm wondering what the design goal of the mirror texture is?

If it is 'to see what the player sees', then maybe observers also need some thick glasses :) So then the vingette makes sense, but maybe not the other effects? or am am missing something here.

4 Replies

  • Since you're responsible for handing the the undistorted texture to the Oculus SDK, there's no reason you can't also use the same texture for your mirror window, without distortion or chroma effects. The only downside is that if you're using the Oculus compositor to put multiple layers together (like a scene and a bunch of UI) then you're responsible for compositing them on the mirror display. If you're just sending one texture, then you're fine doing the mirror yourself.

    One caveat, don't use the Oculus provided textures to do this. If you're drawing directly to the Oculus textures, you'll need to blit the contents to another texture before executing Submit, and before calling your mirror window draw.
  • This is possible with Unity 5.1.1 first party support.

    If you are working with your own engine, then jherico's advice sounds correct.
  • "jherico" wrote:
    Since you're responsible for handing the the undistorted texture to the Oculus SDK, there's no reason you can't also use the same texture for your mirror window


    I had considered using 'the pre-submit texture, but as you mentioned, this misses the compositing, but also the vingette, which almost feels like it should be there, even though I only display one eye on the desktop, 'cyclops mode' as I call it :) So if I do it myself, does the Desktop really reflect what the player sees? ie. no distortion means that no vignette is required anyway?

    Besides the color separation issue, a linear pointer movement within my app seems to be curved on the desktop mirror, which I assume to be the lens 'barrel' distortion. But I also see some sort of delayed shadowing, like the old windows NT pointer trailer option. Difficult to capture or see:

    https://www.youtube.com/watch?v=ZD1ry73TW2I

    Doing all that by hand is going to be a performance hit and seems to make the mirror texture obsolete, which again makes me wonder what the mirror texture is for.


    "cybereality" wrote:
    This is possible with Unity 5.1.1 first party support.

    If you are working with your own engine, then jherico's advice sounds correct.


    yes I'm still working with Java and OpenGL - multi-platform ;)

    Does Unity have access to some of the SDK that we dont then? or is Unity also using the pre-submit texture?
  • The Unity first-party VR support in integrated directly into the engine by them. So they are able to make certain optimizations and things that would be difficult for a plugin. However, if you have your own engine, then I imagine you could do something similar.