# Rendering in onWZVideoFrameRendererDraw callback, is depth buffer available?

**URL:** <https://community.wowza.com/t/rendering-in-onwzvideoframerendererdraw-callback-is-depth-buffer-available/47439>\
**Category:** Wowza GoCoder SDK\
**Created:** [September 25, 2016, 9:56pm UTC](https://community.wowza.com/t/rendering-in-onwzvideoframerendererdraw-callback-is-depth-buffer-available/47439 "2016-09-25T21:56:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Hayton](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@Chris\_Hayton](https://community.wowza.com/u/Chris_Hayton)\
**Post date:** [September 25, 2016, 9:56pm UTC](https://community.wowza.com/t/rendering-in-onwzvideoframerendererdraw-callback-is-depth-buffer-available/47439/1 "2016-09-25T21:56:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Chris\_Hayton](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@Chris\_Hayton](https://community.wowza.com/u/Chris_Hayton)\
**Post date:** [February 2, 2017, 7:44pm UTC](https://community.wowza.com/t/rendering-in-onwzvideoframerendererdraw-callback-is-depth-buffer-available/47439/2 "2017-02-02T19:44:20Z")

</div>

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](http://opengles2learning.blogspot.co.nz/2014/02/render-to-texture-rtt.html)

---

<div class="post-metadata">

**Author:** ![Nelma\_Cernson](https://avatars.discourse-cdn.com/v4/letter/n/ac91a4/32.png) [@Nelma\_Cernson](https://community.wowza.com/u/Nelma_Cernson)\
**Post date:** [July 11, 2017, 1:52pm UTC](https://community.wowza.com/t/rendering-in-onwzvideoframerendererdraw-callback-is-depth-buffer-available/47439/3 "2017-07-11T13:52:22Z")

</div>

Good job! I was just looking for how to do it. Thanks for the answer and for the granted [resource](https://okdissertations.com/writing-services/dissertation-proposal). I’ll try to do similar necessarily.

---

<div class="post-metadata">

**Author:** ![Prue\_Belcher](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@Prue\_Belcher](https://community.wowza.com/u/Prue_Belcher)\
**Post date:** [August 22, 2017, 12:47pm UTC](https://community.wowza.com/t/rendering-in-onwzvideoframerendererdraw-callback-is-depth-buffer-available/47439/4 "2017-08-22T12:47:07Z")

</div>

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](https://www.getacademichelp.com/essay-writers-for-hire) if you run a blog to make it more readable. It’s not very expensive but it is really effective.  
Thanx!
