Results 1 to 2 of 2

Thread: How to do Multiple Meshes? Multiple Programs?

  1. #1

    How to do Multiple Meshes? Multiple Programs?

    Hi guys,

    I'm having troubles here to draw multiple meshes.

    For example a object that spin around another object.
    Both has different texture, different shader behaviors.

    So I created 2 Programs to work with it, one Program for each object.

    Everything work OK,
    If I render each object alone.

    But, when I place all togheter.... here is my problem.
    The last call to glDrawElements always draw above the last. So the objects don't seems to be in the same 3D space, seems more as one 2D image above another (like two render buffers).

    Look, here are a screen of my problem, the tetrahedron should stay behind the cude at this time, not in front of it:

    What is the correct way to work with multiple meshes?

    Some informations about my code:
    OpenGL ES 2.0
    Enabled CULL_FACES
    Using VBO, IBO
    Using different Programs and Shaders for each object.

    As you know, in Cocoa Touch, Apple give it own EGL (EAGL) that don't work with swapBuffer behavior, instead this, it draw to a renderBuffer and after present this buffer to the screen.

    Well, I'm thinking if it can be a problem, if I need to use a renderDepthBuffer to solve this.
    Well, anyone have any idea?

    What is the correct way to render multiple meshes in the same scene using OpenGL ES 2.0?

  2. #2

    Re: How to do Multiple Meshes? Multiple Programs?

    OK OK Guys...

    Thanks for no answers.

    I solved the problem.

    Was really the depth buffer. Or better, the "miss" of it.

    Now I created this render buffer and everything works fine.


Similar Threads

  1. multiple I/O buffers
    By virajk in forum OpenMAX
    Replies: 4
    Last Post: 12-31-1969, 07:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean