opengl-es-2.0

How many Android devices support GLSurfaceView.setPreserveEGLContextOnPause today?

若如初见. 提交于 2019-12-05 07:58:32
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 preserving the context (if less than 5-7%). Alex Byrth Seems that OpenGL-ES 2.0 and forward all allow multiple

OpenGL ES black texture on Nexus S

感情迁移 提交于 2019-12-05 07:22:50
OpenGL code that works on the Nexus One will not work properly on the Nexus S. Textures don't seem to render and I'm left with just black where textures should be. Anyone got any ideas? Daniel Smith The accepted answer given here addresses this issue in slightly more depth than I will, but while this black screen issue does arise from the Nexus S (and some other devices) being strict about power-of-two textures, it does not mean that textures need to have dimensions that are a Po2 . In the texture loading code, one may have the following lines: GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D,

Opengl es 2.0 draw bitmap overlay on video

走远了吗. 提交于 2019-12-05 06:55:41
I am trying to draw a bitmap as an overlay on every frame of the video. I found an example on how to decode and encode a video and it is working. This example has a TextureRenderer class with a drawFrame function that I need to modify in order to add the bitmap. I am newbie to opengl but I learnt that I need to create a texture with the bitmap and bind it. I tried that in the following code but it is throwing an exception. /* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance

How to draw a texture into a quad with OpenGL ES 2?

狂风中的少年 提交于 2019-12-05 06:44:06
Quads are not included in OpenGL ES 2.0 as they were in 1.1. With the programmable pipeline offered by OpenGL ES 2.0, how can I simply draw a texture (originally a png file) into 4 defined points? Do I need a VBO? Do I need to compute a perspective matrix? All these things are messy for me... The platform used is the iPhone. Stéphane Péchard I found the answer. It is mandatory to use a perspective matrix and a shader, even for such a simple task. This answer helped me to do it. Here is the code I used, with functions es*() from this book : // generate an orthographic matrix

iOS OpenGL ES Logical Buffer Loads

守給你的承諾、 提交于 2019-12-05 06:25:02
Slogging through the list of OpenGL API usage performance warnings given by the Analyze instrument, I am finding that we are generating several logical buffer loads per frame - places where we are not clearing a buffer because a draw call completely overwrites it. Counterintuitively, introducing glClear() calls for these cases simply moves the location of the warning to the glClear() calls. Apple implement GL_EXT_discard_framebuffer , however using this on its own is also not sufficient to stop the warning. A glDiscardFramebufferEXT() followed by a glClear() does stop the warning, and improves

Math/OpenGL ES: Draw 3D bezier curve of varying width

元气小坏坏 提交于 2019-12-05 04:43:04
问题 I've been working on a problem for several weeks and have reached a point that I'd like to make sure I'm not overcomplicating my approach. This is being done in OpenGL ES 2.0 on iOS, but the principles are universal, so I don't mind the answers being purely mathematical in form. Here's the rundown. I have 2 points in 3D space along with a control point that I am using to produce a bezier curve with the following equation: B(t) = (1 - t) 2 P 0 + 2(1 - t)tP 1 + t 2 P 2 The start/end points are

Can an OpenGL ES fragment shader change the depth value of a fragment?

冷暖自知 提交于 2019-12-05 03:47:34
Can fragment shader in OpenGL ES 2.0 change the Z value (depth) of a pixel? How is this achieved in OpenGL ES 2.0? No -- gl_FragDepth (which is part of the desktop version of GLSL) is not present in OpenGL ES. You can, however, check for the existence of GL_EXT_frag_depth . If it's available, then you can write the depth to gl_FragDepthEXT . The extension paper gives more details about how to enable the extension and such. While gl_fragDepth is not available in OpenGL ES 2.0, is is available from version 3.0 onwards , so upgrading would be the way to go unless you need to use the older version

OpenGL ES 2.0 screen flickering

家住魔仙堡 提交于 2019-12-05 03:39:14
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 is unresponsive. When this happens, a few lines show up in my logCat: 08-20 10:31:15.390: D

Where is the documentation for OpenGL ES 2.0 on Android?

北战南征 提交于 2019-12-05 03:28:57
问题 The only place I can find documentation on OpenGL ES 2.0 for android is at https://developer.android.com/reference/android/opengl/GLES20.html and at the tutorials on their website. Where can I find an api that explains what the GLES20 methods do? The current api just lists them without any explanation. I've run several internet searches and have had no luck. 回答1: OpenGL ES is managed by the Khronos Group and documentation can be found on their site here: http://www.khronos.org/opengles/sdk

Android OpenGL ES display image fullscreen with aspect ratio

假如想象 提交于 2019-12-04 22:52:35
I want to display an image fullscreen in my OpenGL app without losing its aspect ratio. I know that I can draw an image as a texture onto a "cube" or 2d plane. But I'm not sure if this is really the best way when I just simply want to show a 2d image. Espcially because I want this image to be fullscreen without losing its aspect ratio. I know this is easy with an ImageView. But I need this in my OpenGL ES application. But I have no clue how to do this. Anyone any idea? Since the aspect ratio of your image and the aspect ratio of your view will generally be different, there are two cases. With