Wowza Community

Rendering in onWZVideoFrameRendererDraw callback, is depth buffer available?

I’m trying to render a simple 3D model over the top of a video stream by calling OpenGLES rendering code inside the onWZVideoFrameRendererDraw callback, but z-sorting isn’t working for me.

The same rendering code is working for me elsewhere without problems, so I’m guessing that there is no depth buffer. I tried to check using eglGetConfigAttrib but the EGL10 object doesn’t seem to be provided by WZGLES.EglEnv.

Does the EGLContext used by GoCoder for rendering have a depth buffer? Is there any way to request one?

Just to answer my own question, I was never able to figure out how to obtain a depth buffer in the OpenGLES context available within the onWZVideoFrameRendererDraw callback, so I worked around this by creating a frame buffer object with an associated render buffer with a depth buffer, and using it to render my objects to a texture, then rendering this texture using alpha transparency over the top of the video frame.

This blog post is a useful reference for anyone wanting to do similar:

http://opengles2learning.blogspot.co.nz/2014/02/render-to-texture-rtt.html

Good job! I was just looking for how to do it. Thanks for the answer and for the granted resource. I’ll try to do similar necessarily.

Thanx a lot! it was so hard for me to understand how to do it right but you explained everything clearly and I want to share with you some good advice as well: hire a professional writer if you run a blog to make it more readable. It’s not very expensive but it is really effective.
Thanx!