

Tile based renderers split up the viewport into a number of tiles. In the power constrained environment of a mobile device reducing required memory bandwidth gains significant battery lifetime. The reason for this is to save memory bandwidth, because memory access is actually a power intensive operation. Most mobile GPUs, including the one in the iPad are tile based rasterizers. You're running in one of the peculiarities of mobile GPUs: Those things (except the NVidia Tegra) don't do depth testing for hidden surface removal. Is there something I'm not seeing, or some sort of workaround for this?Īny suggestions or pointers would be greatly appreciated. The program is only rendering 5 models, with around 180 triangles each. But I can't believe that iOS devices are simply too slow to do this. My assumption is that there is a slowdown in performing depth testing, and I also realize I'm working on a mobile device. I'm still somewhat new to OpenGL, so I don't quite know where my problem lies. Additionally, rendering in this order causes translucent and transparent objects to be drawn black. Of course, the slowdown still occurs if any objects in _models must render in front of each other. My frame rate when rendering on top of the background is 30 fps. I found that by changing the render order as follows: for(int x = 0 x < ++x) Send the contents of the render buffer to the UI View. GlUniformMatrix4fv(_projectionUniform, 1, 0, _camera.glMatrix) Pass the camera matrix to the shader program. GlClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) GlBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) This code is called from my draw method, which is defined as follows: - (void)draw


GlDrawElements(,, GL_UNSIGNED_SHORT, 0) GlVertexAttribPointer(_texCoordSlot, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*) (sizeof(float) * 7)) Load vertex texture coordinate attributes into the texture buffer. GlVertexAttribPointer(_colorSlot, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*) (sizeof(float) * 3)) GlVertexAttribPointer(_positionSlot, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), 0) GlUniformMatrix4fv(_modelViewUniform, 1, 0, modelView.glMatrix) Any larger than that and the frame rate drops to between 15 and 20 fps.Īs it stands, all of my models, including the background, are drawn with the following code: - (void)drawSingleModel:(Model *)modelĬC3GLMatrix *modelView = When I attempt to draw a background rectangle, I can only draw objects in front of it that take up less than half the screen. My problem arises when I add objects that appear behind the rest of my models (a background rectangle, for example). When none of the objects overlap each other, the program runs smoothly at 30 fps. I am writing an iOS app using OpenGL ES 2.0 to render a number of objects to the screen.Ĭurrently, those objects are simple shapes (squares, spheres, and cylinders).
