2

I have an opengles 3.1 application that renders fine on the desktop but does not render on android.

The bit that goes wrong is when i have uniform buffer objects. In the vertex shader I have the below for example

layout (std140, binding = 0) uniform matrixUbo
{
  mat4 projection;
  mat4 view;
};

This works ok using deskop drivers but on android it fails. The version of opengles I am testing on is 3.2 compatible and the function calls are available in android.

I have tried both setting the bindings in the vertex shader and setting them using the glUniformBlockBinding method and both don't work on android (but both work on the desktop).

If I don't use those to matrix then the objects do render ok (I can see them ok on my android phone) but when I include those matrix nothing is drawn which tells me the matrix are full of zero's.

Is there anything special that needs to be done for UBO's to be supported on android?

I'm happy to provide more information as required.

abcdef
  • 441
  • 3
  • 13

1 Answers1

1

To answer my own question, they are supported on android opengl es 3.1 but when you update the data you need to use a ByteBuffer not a FloatBuffer even though th function calls support it. Strange issue and a pain to debug!!

abcdef
  • 441
  • 3
  • 13