opengl-es-2.0

How many Android devices support GLSurfaceView.setPreserveEGLContextOnPause today?

你。 提交于 2019-12-07 02:35:56
问题 I don't need the exact number, the percentage would be enough. For example, if I develop an app with 4.0 min SDK version, how can I assure that the context will be preserved? May it depend on the OpenGL-ES version? I tried to find information about chips with limited EGL context but couldn't find any. The reason I need to know - I don't want to implement a special cache subsystem which will reload my textures after the app is resumed. I'm ready to drop some devices that don't support

Using Matrix. Rotate in OpenGL ES 2.0

你。 提交于 2019-12-07 00:15:01
问题 Edit - Added more code Having a lot of problems attempting to correctly rotate my quad using OpenGL ES 2.0. It always seems to rotate around the centre of the screen co-ordinates. I'm trying to get it to rotate around it's own centre (for 2d, so z axis only). I've been experimenting with Matrix.translate as show below. However, changing the x or y pos here simply draws the quad at a different place on the screen, but when it rotates, again it rotates around the centre of the screen. Please

Why is glClear blocking in OpenGLES?

耗尽温柔 提交于 2019-12-06 22:18:33
问题 I'm trying to profile my renderer, and I'm seeing some weird profiling behavior that I can't explain. I'm using a glSurfaceView, which I have set to render continuously. This is how my onDrawFrame() is structured public void onDrawFrame(GL10 unused) { GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); executeAllDrawCommands(); } This was behaving slowly under light load, so I created a timer class and started to profile this some. I was quite surprised by what I saw. I

OpenGL ES 2.0 screen flickering

倾然丶 夕夏残阳落幕 提交于 2019-12-06 21:08:22
问题 I'm facing a big problem. I'm using a Transformer tf101 tab with Android 4.0.3 on it. My app is using a custom OpenGL ES 2.0 surface. I'm rendering multiple planes with textures. this textures are changing approx. 20 times per second and are updated by passing byte arrays. However, in certain cases, the screen begins flickering and does not render the new textures. Additional UI Elements are still responsive and do their work as intended. It seems the OpenGL context ignores all commands and

OpenGL ES 2.0 Object Picking on iOS (Using Color Coding)

拥有回忆 提交于 2019-12-06 15:53:43
问题 This might appear as a related question: OpenGL ES 2.0 Object Picking on iOS Which says Color picker is a good solution, and in deed after reading about it: http://www.lighthouse3d.com/opengl/picking/index.php?color1 It does seem like a very simple solution so this brings me to this question OpenGL ES color picking on the iPhone Which unfortunately uses opengl es 1.0, I am trying to do it in 2.0 so I have no access to the functions described in that question. But the theory seems simple and

iPhone post-processing with a single FBO with Opengl ES 2.0?

a 夏天 提交于 2019-12-06 15:35:57
问题 I am trying to implement post-processing (blur, bloom, etc.) on the iPhone using OpenGL ES 2.0. I am running into some issues. When rendering during my second rendering step, I end up drawing a completely black quad to the screen instead of the scene (it appears that the texture data is missing) so I am wondering if the cause is using a single FBO. Is it incorrect to use a single FBO in the following fashion? For the first pass (regular scene rendering), I attach a texture as COLOR_ATTACHMENT

Creating a bitmap of a drawn square in android opengl es 2.0

旧时模样 提交于 2019-12-06 15:04:19
问题 I have drawn a square using opengl es 2.0 and now i want to create a bitmap of that drawn square. Can anyone please guide me on how to do that? Please let me know if my question is not clear. Thanks 回答1: It is done using glReadPixels(). This is slow, but is the only method available with OpenGL ES 2.0 on Android. In Java: Bitmap buttonBitmap = Bitmap.createBitmap(mWidth, mHeight, Bitmap.Config.ARGB_8888); ByteBuffer byteBuffer = ByteBuffer.allocateDirect(mWidth * mHeight * 4); GLES20

Is there any alternative for GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT)?

喜你入骨 提交于 2019-12-06 14:37:43
I get a fill rate of about 30fps in my application. I know that GLES20.glClear() is used to clear the screen for every draw. If i comment it i get a fps of about 60fps. But the output is not as expected. I have a content to be redrawn for the whole screen in every frame. Is there any alternative where i can redraw the whole screen with out using the GLES20.glClear(). Please let me know if there is any way to play around with GLES20.glClear() to improve the performance? If you overwrite the entire color buffer with your geometry each frame you can get away with just clearing the depth buffer.

Rendering to depth texture - unclarities about usage of GL_OES_depth_texture

好久不见. 提交于 2019-12-06 14:21:35
I'm trying to replace OpenGL's gl_FragDepth feature which is missing in OpenGL ES 2.0. I need a way to set the depth in the fragment shader, because setting it in the vertex shader is not accurate enough for my purpose. AFAIK the only way to do that is by having a render-to-texture framebuffer on which a first rendering pass is done. This depth texture stores the depth values for each pixel on the screen. Then, the depth texture is attached in the final rendering pass, so the final renderer knows the depth at each pixel. Since iOS >= 4.1 supports GL_OES_depth_texture , I'm trying to use GL

OpenGL ES 2.0 Context in Android

痴心易碎 提交于 2019-12-06 11:23:46
I'm new to OpenGL on Android and I have read heavily documented samples, and I kinda understand it. But before trying to do anything complex, I want to draw a simple 2D white rectangle on a black bacground. Nothing else. I'm stuck at this error: call to OpenGL ES API with no current context , which seems to be that I'm calling something from the non-OpenGL Thread . The thing is that I'm not sure what is called from the OpenGL Thread . So here's my code //============== Activity ==================// public class MainActivity extends Activity { public static String TAG = MainActivity.class