Forum Discussion

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

No 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 flawlessly (with this initialisation order : ovr_Initialize, ovrHmd_Create, window and GL context creation, ovrHmd_AttachToWindow, ovrHmd_ConfigureRendering).

The only problem that disturbs me is that I can't get sRGB correction when outputing to the HMD in direct-HMD mode (colors are okay in extended desktop mode). I usually set my color textures to GL_SRGB8 format to get free conversion to linear space when reading textures, and when I output to color framebuffers (or FBO with GL_SRGB8 attached textures) I usually use the GL_FRAMEBUFFER_SRGB option.

With the rift, I use two SRGB8 textures as framebuffers and use the SDK deformation renderer. The ovrDistortionCap_SRGB flag is set in the ovrHmd_ConfigureRendering call, and I get a correct image on my desktop screen, but not in the HMD (too dark, like if I was outputing the linear colors directly). If I omit this flag, the images on both my screen and the HMD are wrong (again, uncorrected linear colors). And this is in Direct-HMD mode only, I have troubles using extended desktop mode (not related to the SDK) but I can see that colors are correct. If I change the texture formats of my framebuffers from SRGB8 to RGB8 I just lose precision in dark colors (banding).

I don't know if the situation is the same with DirectX, but apparently this is a bug in the SDK. Is there some other experience that contradicts mine, or some devs at Oculus who know what's happening in that part of the SDK ? I want to know if this is something that would get corrected in future versions or if I have to do the old trick of sqrt'ing color writes...

Thanks !

20 Replies