Forum Discussion
Anonymous
11 years agoNo sRGB inside HMD (OpenGL, SDK 0.4.3)
Hello, Here is my experience with the DK2 so far. I work with SDL2, OpenGL 3.3 in default profile (compatibility ?) and Windows 7 64 bits for now. I was surprised to get the Direct HMD mode working...
Anonymous
11 years ago"HartLabs" wrote:
Could someone who got OpenGL Direct Mode working provide an example of their initialization code (specifically from ovr_Initialize to ovrHmd_ConfigureRendering)? I have this order but still not functional. I get the same "OVRcreateDXGIFactory2 result 0x0" error popping up in my console that I did in prior SDK versions. An example would help alot!
It's not straightforward to give my init code, as it's not in only one place, but it's almost that :
ovr_Initialize();
hmd = ovrHmd_Create(0);
// stripped fallback if hmd == NULL
ovrHmd_SetEnabledCaps(hmd, ovrHmdCap_LowPersistence | ovrHmdCap_DynamicPrediction);
ovrHmd_ConfigureTracking(hmd, ovrTrackingCap_Orientation | ovrTrackingCap_MagYawCorrection | ovrTrackingCap_Position, 0);
Somewhere else ('x', 'y', 'width' and 'height' are set to hmd->WindowPos and hmd->Resolution values) :
SDL_Init(SDL_INIT_VIDEO);
window = SDL_CreateWindow(title, x, y, width, height, SDL_WINDOW_OPENGL | flags);
context = SDL_GL_CreateContext(window);
glewInit();
And then :
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
SDL_GetWindowWMInfo(getWindowState()->window, &info);
union ovrGLConfig glcfg;
memset(&glcfg, 0, sizeof(glcfg));
glcfg.OGL.Header.API = ovrRenderAPI_OpenGL;
glcfg.OGL.Header.RTSize = hmd->Resolution;
glcfg.OGL.Header.Multisample = 0;
#if defined(OVR_OS_WIN32)
glcfg.OGL.Window = info.info.win.window;
glcfg.OGL.DC = wglGetCurrentDC();
if (!(hmd->HmdCaps & ovrHmdCap_ExtendDesktop))
ovrHmd_AttachToWindow(hmd, info.info.win.window, NULL, NULL);
#elif defined(OVR_OS_LINUX)
glcfg.OGL.Disp = info.info.x11.display;
glcfg.OGL.Win = info.info.x11.window;
#endif
for (int i = 0; i < 2; i++) {
ovrSizei size = ovrHmd_GetFovTextureSize(hmd, ovrEye_Left + i, hmd->DefaultEyeFov[i], pixelDensity);
frameFBO[i] = createFBO(size.w, size.h, blahblahblah...);
frameDesc[i].OGL.Header.API = ovrRenderAPI_OpenGL;
frameDesc[i].OGL.Header.TextureSize.w = size.w;
frameDesc[i].OGL.Header.TextureSize.h = size.h;
frameDesc[i].OGL.Header.RenderViewport.Pos.x = 0;
frameDesc[i].OGL.Header.RenderViewport.Pos.y = 0;
frameDesc[i].OGL.Header.RenderViewport.Size.w = size.w;
frameDesc[i].OGL.Header.RenderViewport.Size.h = size.h;
frameDesc[i].OGL.TexId = frameFBO[i]->color[0]->id;
}
if (!ovrHmd_ConfigureRendering(hmd, &glcfg.Config, ovrDistortionCap_Chromatic | ovrDistortionCap_Vignette | ovrDistortionCap_TimeWarp | ovrDistortionCap_HqDistortion | 0*ovrDistortionCap_SRGB | ovrDistortionCap_Overdrive, hmd->DefaultEyeFov, eyeDesc))
argh();
Only tested on Win 7 x64.
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
- 9 months ago
- 2 months ago
- 5 months agoAnonymous