

To see what version of OpenGL the device supports. Want to use 3.0 features if they're available, you should check at run time If you specify that a lower-level version is required but you OpenGL ES 3.0 is required, you can be sure that that version will be present Implementation of this graphics pipeline. The OpenGL ES 3.0 API unless the device manufacturer provides an Regardless of the Android platform version, a device cannot support

It works much faster, but i dont understand how to set different textures for triangles if it necessary.Android includes support for high performance 2D and 3D graphics with the Open Graphics Library GlDrawArrays(GL_TRIANGLES, 0, 3*obj->CountTr) I've tried to declare vertex array and other as float vertices and in cycle just set the values of array.

Gl_FragColor = u_TextureFlag*texture2D(u_Texture,v_TexCoord)*v_Color + (1.0 - u_TextureFlag)*v_Color Gl_Position = mvpMatrix*vec4(a_Position, 1.0) įragment shader: precision mediump float Mat4 mvpMatrix = u_projectionMatrix*u_modelviewMatrix Vertex shader: attribute vec3 a_Position GlVertexAttribPointer(a_color, 4, GL_FLOAT, GL_FALSE, 0, color) GlVertexAttribPointer(texpos, 2, GL_FLOAT, GL_FALSE, 0, texcoords) GlVertexAttribPointer(pos, 3, GL_FLOAT, GL_FALSE, 0, vertices) ĬheckGlError("glEnableVertexAttribArray") GlBindTexture(GL_TEXTURE_2D, obj->triangles.numtex ) If(obj->lor m_vis_koef Ĭolor = 1.0f color = 1.0f color = 1.0f color = obj->m_vis_koef Ĭolor = obj->lor color = obj->lor GlTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT) GlTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT) GlTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)

GlTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST) Loading bmp file and creating texture: void CreateTexture(unsigned &texture, const char * fileName) Function texture2D(u_Texture,v_TexCoord) in my fragment shader returns vec4(0.0, 0.0, 0.0, 1.0) for each triangle.Each triangle have vertex coordinates, colors, texture and texture coordinates. There are many 3D objects(1000+) constructed by triangles and i need to draw it using Android NDK and OpenGL ES 2.0.
