Sign in to follow this  

Z-Buffer Issues

Recommended Posts


I'm developing a very basic 3D world type application but I'm having trouble with my z-buffer. Essentially, I load models from Obj files and each separate model has its own model matrix - I then multiply this by the view/projection matrix as each one is rendered.

Each model has its own VAO/VBO and then in the main loop I just call `model1.render()` then `model2.render()` etc. The render method loads the relevent VAO/VBO and then calls drawArrays(). Problem is, the z-buffer appears to be doing nothing. So if I have cube at (0,0) and a sphere at (0,10) - all the time that the cube render call is after the sphere render call, the cube is rendered in front of the sphere.

I can't figure out what the issue is at all? Is it because I use the separate VAOs/VBOs?

Many thanks

Jon Edited by jonseager

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this