Forum Discussion

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

OpenGL Shader Issues with 0.5.0.1

Since upgrading my OpenGL application to 0.5.0.1 I've noticed some lighting issues. They seem to be related to rotations I apply to the camera; as I apply roll to the object to which I've attached my camera the scene gets darker. If I leave the object level and instead apply roll by physically rotating the Rift I don't see the same effect. This problem doesn't happen if I run without using the Rift. I'm guessing that one of my shaders is now conflicting with one of the ones from the SDK.

I found a number of posts about OpenGL state leaks but from what I can tell they were reported against earlier versions of the SDK. I've actually never experienced any leak issues in any of the earlier versions of the SDK but perhaps now something has come up; are there any (new or previously existing) state leak issues with 0.5.0.1?

In the 0.4.4 SDK I found the shaders in LibOVR\Src\CAPI\GL\CAPI_GL_DistortionShaders.h but after searching through the 0.5.0.1 SDK I haven't been able to locate them. Are they still publicly available?

Has anyone had success with any shader debugging tools? I'm not able to use Nsight (which seems to require recent core profile support). I'm using NVIDIA hardware so I don't think CodeXL will work. Some of the others appear as if they might be replacing or applying a shim to opengl32.dll which seems like it could interfere with the shim applied by the SDK. I'm going to start some testing but in the meantime if anyone has a tool that's worked well for them please let me know.

4 Replies

  • Grab the Linux SDK to get the shader sources. The win and OSX sdks don't seem to be complete for source code. Alternatively you might try client side distortion. Personally I've never been able to get nSight to work with rift distortion turned on, but I haven't tried very hard. It would probably work better in extended mode.
  • FWIW, I've been able to get CodeXL to work even though I'm on NVIDIA hardware. Although it only supports shader debugging for DirectX, I have been able to get some useful information out of it. I've been able to open up and view both the textures I'm passing to the Oculus SDK and the textures generated by the SDK and in both cases the lighting is wrong which at least tells me this isn't something that's happening inside the SDK. However I am still suspicious that this is a new state leak because I never had this problem until I moved up to 0.5.0.1.
  • skynet's avatar
    skynet
    Honored Guest
    Since 0.4.4 OVRLib is using its own GL context for any rendering. Since then, state cannot leak into your rendering context anymore - except that very strange thing where suddenly FBO 0 can't be bound anymore and some mysterious FBO 2 will be bound instead. I haven't figure pout where that happens, definitely not in the open source portion of the SDK.

    Anyway, with the advent of 0.6.0, all these problems should go away completely as they seemed to have removed all distortion rendering from the client's process. (I REALLY hope they fixed the handling of sRGB textures in the distortion code as I suspect we won't be able to fix the distortion rendering code on our own anymore :-/ )
  • "skynet" wrote:
    except that very strange thing where suddenly FBO 0 can't be bound anymore and some mysterious FBO 2 will be bound instead. I haven't figure pout where that happens, definitely not in the open source portion of the SDK.


    This has something to do with how they're doing the shim to make Direct mode rendering work. If you're in extended mode this doesn't happen.