GLES 3.0 emulator instanced rendering problem

This topic contains 2 replies, has 2 voices, and was last updated by  chris 1 year, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #53094

    ivanov161
    Member

    Hi all!

    I want to get benefits of instanced rendering. But I have no success when I use GLES3.0 PowerVR emulator from PowerVR SDK v. 4.0.
    I need to draw unit quad in random positions. Positions are passed to shader as attributes – 1 position per instance using glVertexAttribDivisor. As result I see only 5 rectangles of 100. I tested instancing with desktop OpenGL and I see all 100 instances of quads.
    Is it known issue or am I doing smth wrong?
    Please, see attached solution for details.

    Attachments:
    You must be logged in to view attached files.
    #53099

    ivanov161
    Member

    Additional workaround:
    I noticed, that rendered instances count depends on count of vertices.
    I tried to render 2 quads – count of rendered instances increased to 9.
    Vector3f vertices[] = {
    Vector3f ( -0.5f, -0.5f, 0.0f ),
    Vector3f ( -0.5f, 0.5f, 0.0f ),
    Vector3f ( 0.5f, -0.5f, 0.0f ),
    Vector3f ( 0.5f, 0.5f, 0.0f ),
    Vector3f ( -0.5f, -0.5f, 0.0f ),
    Vector3f ( -0.5f, 0.5f, 0.0f ),
    Vector3f ( 0.5f, -0.5f, 0.0f ),
    Vector3f ( 0.5f, 0.5f, 0.0f )
    };

    Vector2f texCoords[] = {
    Vector2f ( 0.0, 0.0 ),
    Vector2f ( 0.0, 1.0 ),
    Vector2f ( 1.0, 0.0 ),
    Vector2f ( 1.0, 1.0 ),
    Vector2f ( 0.0, 0.0 ),
    Vector2f ( 0.0, 1.0 ),
    Vector2f ( 1.0, 0.0 ),
    Vector2f ( 1.0, 1.0 )
    };

    glDrawArraysInstanced ( GL_TRIANGLE_STRIP, 0, 8, R_COUNT );

    I guess, that position attribute is not fetching correctly in accordance to glVertexAttribDivisor parameters.

    #53100

    chris
    Moderator

    Hi ivanov161

    This is a known bug in the current version of the emulator which occurs when using client-side vertex data. As a workaround you could upload your data into a vertex buffer and then the divisor setting should work correctly.

    1 user thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.