Forum Discussion
davidwyandgg
13 years agoExplorer
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
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
- cyberealityGrand ChampionHey 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 - davidwyandggExplorerHey 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 - cyberealityGrand ChampionOn 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.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 months ago
- 6 months ago