opengl-es

Android NDK OpenGL glDeleteTextures causes error: call to OpenGL ES API with no current context

我只是一个虾纸丫 提交于 2019-12-25 04:22:34
问题 I am working on an android application which renders video from an external camera. The video frames are rendered to the screen through opengl in the NDK layer as we do the communication with the camera in ndk and it is faster. I did not write the code as it came from a 3rd party (the developer of the camera) and they have implemented the method surfaceDestroyed in MyGLSurfaceView as follows: @Override public void surfaceDestroyed(SurfaceHolder holder) { Log.d(TAG, "Inside GL surfaceDestroyed

Android NDK OpenGL glDeleteTextures causes error: call to OpenGL ES API with no current context

血红的双手。 提交于 2019-12-25 04:22:23
问题 I am working on an android application which renders video from an external camera. The video frames are rendered to the screen through opengl in the NDK layer as we do the communication with the camera in ndk and it is faster. I did not write the code as it came from a 3rd party (the developer of the camera) and they have implemented the method surfaceDestroyed in MyGLSurfaceView as follows: @Override public void surfaceDestroyed(SurfaceHolder holder) { Log.d(TAG, "Inside GL surfaceDestroyed

OpenGL ES 2.0 Alpha

旧时模样 提交于 2019-12-25 04:15:59
问题 I am trying to load a texture PNG ( exported by photoshop) and use it in OpenGL ES 2.0 in Android, but the solid color seems like transparent ( black circle in the png is totally black) I has been read that if you scale a png more than 50% that bug appear( I tested with scaling more and same so I supposed that is not the case) I also read that BitmapFactory dont read premultiplied alpha PNG ,I tryed another fuction that supposed that do the work but didnt work( maybe it was wrong) Any ways to

OpenGL ES 2.0 an Android: What dimensions should the normalMatrix have?

女生的网名这么多〃 提交于 2019-12-25 02:57:11
问题 I am learning OpenGL ES 2.0, without ever having learned OpenGL or OpenGL ES 1.x. I'm applying non-uniform scaling to my modelViewMatrix, so the tutorials tell me that I need to take special steps to compute a normalMatrix. In my application the modelViewMatrix has dimension 4x4. Some tutorials say that for the normalMatrix I need to simply calculate transpose(inverse(modelViewMatrix)). Other instructions say that I need to first take the upper left 3x3 sub-matrix of my modelViewMatrix and

OpenGL ES Object is Displaying Strangely / Distorted - Android

风格不统一 提交于 2019-12-25 02:34:12
问题 EDIT OK - I grabbed a device and..guess what...it displays correctly ? Does anyone know why this would be happening on the simulator only ? Thank you. I am trying to draw an object using glDrawElements on Android. I am using the code below to read in my vertice and indice data and then draw the object in my render method. I am testing this on the simulator rather than a real device. This is my scene object code : import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio

Drawing curved lines in AndEngine

北慕城南 提交于 2019-12-25 02:10:57
问题 I am new to AndEngine and very happy that it's very easy and exciting thing to do. Unfortunately I am unable to draw a curved line in AndEngine. Actually my scenario is that I have an animated sprite say Object. I want to move this object on a Line with the points given onToucing and dragging it. Now the problem is that I can't find any method to draw a line on points in a way that it does not produce corners. I want a smooth line with no corners. Suppose I touch the object and drag it on the

GLSL vertex shader gl_Position for gl.POINTS with large gl.PointSize

隐身守侯 提交于 2019-12-25 01:43:52
问题 I'm trying to render a lot of points with large gl_PointSize. Looks vertex shader will automatically discard gl.POINTS rendering if the position is out if[-1, 1]. In my case, if the point's position is a little bit out of [-1, 1], part of it still should be shown on the canvas. Any way to let the shader keep rendering point, when position out of [-1, 1]? Here's the code to draw a point with position a little bit off the canvas. But it is expect to show nearly half of it on canvas. var

Android - Gaussian blur like effect - OpenGL

左心房为你撑大大i 提交于 2019-12-25 01:19:50
问题 Where not specified this question is just building on top of the CameraCaptureActivity within the grafika project found on github. It has a built in blur effect that utilises a 3x3 kernel kernel = new float[] { 1f/16f, 2f/16f, 1f/16f, 2f/16f, 4f/16f, 2f/16f, 1f/16f, 2f/16f, 1f/16f }; However this blur effect is not strong enough, im looking for something like what the gaussian effect can do on iOS with UIVisualEffectView , it looks something like this: A nice smooth heavy blur effect but so

overlapping partially transparent shapes in openGL

扶醉桌前 提交于 2019-12-25 01:14:47
问题 Please check this neat piece of code I found: glEnable(GL_LINE_SMOOTH); glColor4ub(0, 0, 0, 150); mmDrawCircle( ccp(100, 100), 20, 0, 50, NO); glLineWidth(40); ccDrawLine(ccp(100, 100), ccp(100 + 100, 100)); mmDrawCircle( ccp(100+100, 100), 20, 0, 50, NO); where mmDrawCircle and ccDrawLine just draws these shapes [FILLED] somehow... (ccp means a point with the given x, y coordinates respectively). My problem .... Yes, you guessed it, The line overlaps with the circle, and both are translucent

How do I offset a sector of circle from its origin based on the current angle

守給你的承諾、 提交于 2019-12-24 20:34:15
问题 I'm trying to work out how to create a new vector position or destination vector position to represent an extracted section of a circle (or piece of pie) given the current angle. Specifically I need to work out the total float value needed to reach the destination vector from the current vector by incrementing x and y per frame for my animation - (this part is already done just some background info). I have already determined the following bits of information in my program...here's a sample: