opengl-es

Manipulate a Custom GLSurfaceView in Android

断了今生、忘了曾经 提交于 2019-12-11 12:09:00
问题 I have a Custom GLSurfaceView created by D.J.I. The video rendering is done by their own compiled class and it allows only one GLSurfaceView to receive their encoded video. I would like to multiply the video output on the screen to view with a V.R viewer, but not sure if it is possible. I know that by coping their custom GLSurfaceView I can do some manipulation, such as controlling the size of the video output. (if I change this line: "SplitDjiSurfaceView.w = width;" to "width/2") I'll get

Load Uniform Matrix 1104 GL_Invalid_Operation Android OpenGLES 2.0

﹥>﹥吖頭↗ 提交于 2019-12-11 12:06:26
问题 I am working on implementing rendering to texture on Android 4.3+ (OpenGLES 2.0) I am getting the following error in my DrawFrame() method: 01-15 13:40:07.545: W/Adreno-ES20(23709): <__load_uniform_matrix:1104>: GL_INVALID_OPERATION 01-15 13:40:07.545: E/com.hpp.STextureRender(23709): glDrawArrays: glError 1282 01-15 13:40:07.545: D/io.hpp.CaptureManager(23709): Error encountered in drawFrame = glDrawArrays: glError 1282 01-15 13:40:07.545: W/System.err(23709): java.lang.RuntimeException:

Use UIMotionEffect with OpenGL ES

喜欢而已 提交于 2019-12-11 12:06:14
问题 I'm using OpenGL ES (2.0) exclusively for my app. I'm trying to get UIMotionEffect to work with one of my OpenGL objects - where all I need are the "tilt" values. UIInterpolatingMotionEffect can only be applied to a UIView , and a hack would be to apply UIInterpolatingMotionEffect to a UIView and grab the values from there per frame, while not rendering the supposed UIView . But it seems far too hack-ish to be the only solution. I tried to subclass UIMotionEffect , but couldn't figure out how

Got Opengl error 0x505 while texture cache statistic is low

时光总嘲笑我的痴心妄想 提交于 2019-12-11 11:26:45
问题 I am developing an android game using cocos2dx 2.2 + lua. While testing,I got a lot of 'opengl error 0x505' from logcat. According to opengl doc, this means 'out of memory'. Hence, I print out texture cache every 3 seconds using cocos2d::CCTextureCache::sharedTextureCache()->dumpCachedTextureInfo(); The output of dumpCachedTextureInfo() shows that the highest texture cache is 70M, but no 'error 0x505' occurs. 'error 0x505' come out while the cache is low, e.g. ~35M. My question is, isn't

Rendering an image texture into a cubemap in openGL android

心已入冬 提交于 2019-12-11 11:10:04
问题 I have a bitmap on my device(which is a 6x1 cubemap), which I want to render on all the faces of the cube InputStream is = getContext().getResources().openRawResource(R.raw.photo); Bitmap bitmap = BitmapFactory.decodeStream(is); int bytes = bitmap.getByteCount(); ByteBuffer pixels = ByteBuffer.allocate(bytes); bitmap.copyPixelsToBuffer(pixels); Here is my vertex shader: uniform mat4 uMVPMatrix; uniform mat4 uSTMatrix; attribute vec4 aPosition; attribute vec4 aTextureCoord; attribute vec4

OpenGLES extension in Android

ぐ巨炮叔叔 提交于 2019-12-11 11:02:35
问题 I'd like to use glBeginQuery(GL_TIME_ELAPSED,query) in OpenGLES, so I found out that this can be done using this extension: EXT_disjoint_timer_query and only OpenGL ES 2.0 or greater is required. My device is a Nexus 4 and I found here that it supports this extension. But when I use String extensions = GLES20.glGetString(GLES20.GL_EXTENSIONS); , I can't see this extension avaiable there. Do you know what could be the problem? Thanks! 来源: https://stackoverflow.com/questions/22565195/opengles

Errors after changed OpenGL code from ES 1.0 to ES 2.0

泄露秘密 提交于 2019-12-11 10:58:02
问题 I changed code from ES 1.0 to ES 2.0 in cocos2d-x Code in ES 1.0 version const float DARK=30.0f; int n = m_sGridSize.x * m_sGridSize.y; glEnable(GL_CULL_FACE); glDisableClientState(GL_COLOR_ARRAY); glVertexPointer(3, GL_FLOAT, 0, m_pVertices); glTexCoordPointer(2, GL_FLOAT, 0, m_pTexCoordinates); glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, m_pIndices); glFrontFace(GL_CW); glDisable(GL_TEXTURE_2D); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glColor4ub(255-(m

Can a texture be updated in background thread but printed in foreground thread?

帅比萌擦擦* 提交于 2019-12-11 10:54:15
问题 In webRTC, in SurfaceTextureHelper the surfaceTexture (with handle the creation/update of the openGL texture) is created inside a background thread: final HandlerThread thread = new HandlerThread(threadName); thread.start(); an inside this newly created thread we do oesTextureId = GlUtil.generateTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES); surfaceTexture = new SurfaceTexture(oesTextureId); The problem is that the OnFrameAvailableListener of the surfacetexture will be called in the thread where

QOpenGLWidget not drawing array

北城以北 提交于 2019-12-11 10:49:18
问题 you´re my last resort for this question because Im out of ideas. So first of all I have already done some openGL stuff but not with the Qt Libraries. And since I HAVE to do it with Qt Libraries because of the Qt Android compiler, theres no way around for me. So I was trying to draw some vertex coordinates like in normal openGL. Save points in float array etc.. So I hoppyfully made the right vao, vbo.. shader.. but it won´t draw anything. paintGL() only draws something if its hardcoded with

Warp texture with opengles

你。 提交于 2019-12-11 10:48:59
问题 I'm making an Android app using opengles 2.0 and I have camera preview like this : and using this as a texture. But I want simply warp in side of the red donut shape. So I'm trying to crop that part from the texture and mapping to a shape like a rectangular. But I don't know how exactly crop that part is there any ways to do that efficiently? 回答1: Lets assume we have a rectangle R with uv coordinages (s, t) where s,t element [0,1]. And we have the ring given by a center C, a inner radius ri