Skip to main content
Up and Coming
March 1, 2013

Handy Things to Move Into the SDK

Hey Rift Peeps!

While working on the HMD side of the SDK I found that I needed to dissect and make use of parts of the OculusWorldDemo. These calculations will be required for anyone that is attempting to use the distortion shader so are good candidates to move out of the demo and into the SDK itself. Perhaps they could go under a utilities section, or even as part of the HMDInfo class?

XCenterOffset
This is currently calculated as part of StereoConfig::updateDistortionOffsetAndScale(). This could be a function that takes a HMDInfo and returns the calculated XCenterOffset.

Distortion Scale
This is also currently calculated as part of StereoConfig::updateDistortionOffsetAndScale(). This could be a function that takes a HMDInfo and returns the calculated Scale. It would also be good to have an optional bool that will calculate the Scale without attempting to fit in any direction (i.e. don't want to upscale the input texture). In the current StereoConfig calculation this would be the equivalent of setting both DistortionFitX and DistortionFitY to 0.

Vertical FOV
Currently calculated as part of StereoConfig::updateComputedState(). This function could take a HMDInfo along with the distortion Scale calculated above and return the vertical FOV.

Thanks!

- Dave

    3 replies

    Inspiring
    March 2, 2013
    Hey Dave,

    We're currently refactoring some of this code, and creating utility functions is something we're considering. Right now, the code is intertwined with the OculusWorldDemo, and we are trying to remove the dependencies in some of the classes (like StereoConfig) so you can use them more easily in your own projects.

    We're still brain-storming how all this is going to work, so I can't make any promises, but it's certainly something we're investigating. For the time being, the best thing to do is just copy out any relevant code from the demo and integrate it directly into your own code-base.

    Hope that helps,

    - Andres
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    March 2, 2013
    Hey Andres.

    Yup, that's exactly what I've done with my code base. So I don't personally need these changes to be in place. But if you could break out functions such as these from the demo, I believe it will help new people get a better handle on things. Part of the OVR SDK learning curve is separating what is required to work with the HMD, and what is required just for the demo itself to function.

    - Dave
    Torque 3D, open source game engine Torque 3D Game Development Cookbook
    Inspiring
    March 4, 2013
    On the wiki, I've posted a tutorial with the absolute minimum amount of code you need to work with the SDK:

    https://developer.oculus.com/wiki/ind ... pplication

    It doesn't calculate the FOV or stereo parameters, it just has the code needed for head-tracking and getting some basic information from the headset. Hopefully that can help people get started.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV