I am trying to write an plugin for Maya, using -among other things- OpenGL. Everything works fine so far, but the final Maya scenario is not taking into account the OpenGL depth buffer (or OpenGL is not taking into account the Maya depth). Hence, OpenGL things always appear "over" the Maya native objects.
I looked at the Maya's documentation and I found out that you can get Maya's depth may through MStatus M3dView::readDepthMap function, which basically returns a float array with Maya's depth.
I am now in a situation where I have two float arrays, one with OpenGL depth's and another with Maya's depth, and I believe I should combine them both somehow to get a final render in Maya that would respect both depth maps.
So, the question is, is there anyway to "add" depth information into OpenGL's renderbuffer / depthbuffer? Or... I am trying a completely wrong approach and there's a much nicer and better way to do this?
Thanks a lot!