Forum Discussion

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

compositor layers issues with unity 2017

Hello everyone, i am a video player software developer using oculus 1.18.1 sdk for unity 2017.1.1f1, the target platform is sumsung s7

while i choose to optimize the clarity of ui texture & font with vr compositor layer techs in there https://developer.oculus.com/documentation/unity/latest/concepts/unity-ovroverlay/, i need seriously helps to use the OVROVERLAY tech correctly. docs has less information to solve this

1.the overlay render result shown on screen by ovroverlay.cs change its light intensity seriously compared with camera capture result, which has OVRRTOverlayConnector & camera's rt isn't null, even in oculus sdk demo scene, the overlay quad final screen render result light intensity differs obivous with normal quad.  

first is overlay result, second is normal
so, can anyone tell me how to make overlay's camera capture render result not darker while using overlay tech, but use the normal render result like second pic.

2.overlay demo show how to render a overlay ui panel directly facing the orthographic camera. calculating the ui panel's world size & pos and send params & texture to create overlay panel
is there a way to render ui panels not directly facing camera? like this rotate panel can't using orthographic camera to render, can someone show me the core codes to realize it  or overlay cylinder shape can do it? 



3.in compositor layer doc, it says " VR compositor layers are displayed as overlays in front of the eye buffer", but if i use quad shape overlay to render ui, the front of ui will be nothing rendered, even  gear controller model can not cover ui because ui is "overlay".

i know set gear controller rendered by overlay camera can solve this problem, but the gear controller can not be rendered with orthographic like demo because it is a 3d model. is there a way to show something in front of overlay layers? or can some one tell me how to use overlay camera projection not orthographic~~~~ and calculate the overlay obj size & pos


















    

3 Replies

Replies have been turned off for this discussion


  • @wangxiaogangan

    Would you be willing to provide us with a copy of your project for our review?


    Thanks for reply in first~~
    i handle with question 1 using a gammar correct for overlay camera render texture, the final rendering result is much brighter as expected.

    hoping there will be a method for rendering overlay gameobjects with perspective projection in the future.

    the code comes from studio project, i can share the code for oculus official staff  with signing a nda, if u interested contact me with wangxiaotian@sourcetech.xyz

  • 2.overlay demo show how to render a overlay ui panel directly facing the
    orthographic camera. calculating the ui panel's world size & pos
    and send params & texture to create overlay panel is there a way to render ui panels not directly facing camera? like this rotate panel can't using orthographic camera to render, can someone show me the core codes to realize it  or overlay cylinder shape can do it? 

    Not with OVROverlay. The
    point of OVROverlay is to ray-cast into the quad for high-quality sampling. If you
    add a sampling step between the raycast and the quad, it will at least as much
    aliasing as if you didn't use OVROverlay at all. 




    I'm really wondering what y'all are doing internally to achieve such great looking textures in a non-orthogonal projection, then. I've noticed so many weird quirks with Overlay rendering that have no documented explanation, like for example textures not updating in any way when moving objects on the Z axis (not even a 2-dimensional scale effect that would result from moving closer to you in a 2D projection), regardless of if they're Render Textures or World Space Quads.

    There are many instances in Oculus-developed software such as the user's "tablet" in Oculus Rooms where there are extremely clear and high-quality dynamically loaded textures with no noticeable compression artifacts or aliasing that are on tilted surfaces. I'm a blind man in a technical artist's world, but I've been sifting for months through advice about texture compression settings, mip map generation, anisotropic filtering, etc etc etc and I just don't get how to avoid the "resampled look" without Overlay rendering.

    I realize that what I'm talking about here at a high level is just an aggregate of many many different design choices responding to technical rendering limitations and a lot of special sauce (welcome to game development), but we all want to have the kind of cleanliness and sharpness that Oculus leads the way on with its own apps in UI, UX, and visual quality. We all want to make this strong first impression to first-timers and the public at large. The methods for achieving this are NOT laid before you with just Unity and the help provided to you as a developer with the Oculus Utilities, the Sample Framework, and whatever bits and bobs have been written and published by Oculus.
  • @wangxiaogangan ! If you're still trying to figure out how to do a rotated Overlay layer of a Render Texture, I figured out a solution. It's highly dependent upon the way me and the other devs on our team have set up showing different screens in our UI, but I don't think it's an unorthodox solution.

    We are also building video player functionality, and wanted to use OVROverlay to render the playback controls, which are on a Canvas that has been tilted +30degrees on X.
    1. Create a new Overlay Component GameObject and Camera GameObject pair for capturing the Canvas element you want to tilt.
    2. Set the Camera to Orthographic Projection and give it a Culling Mask with the Layer of the Canvas element that you want to capture.
    3. Unrotate your Canvas element so that it's laid out totally flat in World Space.
    4. Set up the Scale of the Overlay Component's Transform to match the size you need your Render Texture to be to capture the whole Canvas as tightly as you can, so the resulting TimeWarp Layer will be as sharp as it can possibly be. (I like to measure it with an untextured Quad laid on top of my Canvas and then copy-paste the Transform value over, just like they do in the demo of Overlay Rendering in the Oculus Sample Framework.)
    5. Make sure your Canvas element and your Overlay Component are aligned in Z-depth.
    6. Duplicate your Canvas element and split it out into two pieces: all of the graphics it uses on one Canvas, and all of its Box Colliders, Scripts, and UI Components on the other. Fix all the references so that they point to each other.
    7. Re-rotate the functionality-only Canvas so that it matches the rotation that you want your Overlay version to have when it gets rendered on the Gear/Go.
    8. Rotate the Transform of the Overlay Component to match the rotation in #7. Note that the location of the Canvas + Camera can be in a totally different place than the Overlay + Hitbox Canvas. You could put it at (0,0,0) if you want, the Culling Mask will hide it. (You could double check that they overlap with the test Quad from #4 if you want.)
    9. Voila!
    It's definitely both a labor intensive and brittle solution, but it works with non-cylindrical overlays that don't need to move when they're up. (Rotating the whole hitbox canvas and overlay component to recenter to the user's view should work fine, though.)

    I hope that makes sense. Let me know if you try it and get stuck. I've been dying to figure out a solution and was super stoked to figure this out.