sensics / OSVR-RenderManager

Apache License 2.0
64 stars 45 forks source link

Adding direct rendering to a new HMD #290

Closed raunaqbn closed 7 years ago

raunaqbn commented 7 years ago

I am working on adding OSVR support to a custom HMD and needed help setting up direct rendering.

I have already added the Headset vendor ID to the Nvdia direct mode whitelist in the Nvidia driver. I followed the instructions here and was able to build the render manager but I was not able to clone the NDA repositories since that requires permission and is for internal sensics users.

I have both the Nvidia Direct Mode and Liquid VR package libraries. Is there a way for me to configure the render manager to use with these libraries ? I want to be able to use the async timewarp capability in the render manager and was wondering if someone could help me with the procedure?

Currently when configuring in CMake I get the following message:

I was wondering if you could help clear up what the steps are to get direct rendering working and built in the render manager.

VRguy commented 7 years ago

Is there a particular reason you need to rebuild the NDA repos? I think the way OSVR works is that once you define the device descriptor for your device (see high-level steps at the bottom of this page: http://sensics.com/integrating-hmds/), you should be able to just use the prebuilt distros.

russell-taylor commented 7 years ago

Glad to hear that you are adding OSVR support to your new HMD! Once you have the display white-listed on nVidia's driver, you can launch it using a standard RenderManager build. You and your customers can either specify the Vendor ID in the config file, or you can give it a nickname by adding it to the list at https://github.com/sensics/OSVR-RenderManager/blob/master/osvr/RenderKit/DirectModeVendors.h#L225 and doing a pull request, which will get it into future OSVR releases.

raunaqbn commented 7 years ago

Hi Russell, Thanks for your reply! I tried adding the vendor Id to the display configuration file but the sample applications are failing at OpenDisplay() and not able to detect the HMD. I tried passing the PnPID to the enable/disable direct mode executables in command line and that works fine but none of the 3d examples seem to work. Is there any other config file I need to edit? Currently I modified the following field: "device": { "vendor": , "model": "", "Version": "", "Note": "" } I understand that the pull request method will work but I wanted to test out some Render manager features before doing so.

Note: extended mode works like a charm. Love the entire OSVR effort :)

russell-taylor commented 7 years ago

Glad to hear that extended mode is working. I just added a pull request https://github.com/sensics/OSVR-RenderManager/blob/russell-taylor-patch-2/doc/renderManagerConfig.md to update the documentation to describe that you need to set the 3-letter name associated with the hardware vendor ID. This is the same name you can use with the enable/disable direct mode commands.

If enable/disable are working but open is not, then make sure you are listing a resolution that is available on the HMD. The width and height, together with the rotation, specify the final resolution. The driver looks through the available modes until it finds one that matches.

raunaqbn commented 7 years ago

Hey Russell, That worked for me. I had the width and height of mixed up for direct mode. Unfortunately the render manage now renders the images rotated at 90 degrees. I tried modifying the rotation in the display configuration in the render manager to 90 degrees as follows:

    "display": {
        "rotation": 90,
        "bitsPerColor": 8
    },

that lead to the invalid display mode index error:

error [RenderManager]: Invalid display mode index: -1 (mode not found based on either index or parameters) Could not open display

It seems like my display can handle only portrait resolutions and there is no way to modify the hardware EDID. Is there a way to perform a rotation on the frames being submitted to the OSVR rendermanager before they get presented to the display?

russell-taylor commented 7 years ago

You will want to swap the resolution (width and height) when you rotated 90 degrees. That should get you going.

raunaqbn commented 7 years ago

That worked for me. Thanks!