opengl-es-2.0

Modifying camera output using SurfaceTexture and OpenGL

落爺英雄遲暮 提交于 2019-11-26 21:29:44
I am trying to filter the stream coming from the camera hardware by running it through an openGL filter, then displaying it in a GLSurfaceView. When openGL goes to render the frame, the LogCat repeatedly spits out an error: [unnamed-3314-0] updateTexImage: clearing GL error: 0x502 0x502 is a generic openGL error, and doesn't really help me track down the problem. This is a sequence of how the code works (or atleast should be working as seen in my head), and I've copied my code below that. I am hoping that somebody else can see what my problem is. Create new MyGLSurfaceView. This internally

How to draw a circle using VBO in ES2.0

你离开我真会死。 提交于 2019-11-26 21:07:40
I am trying to develop an ES 2.0 application in Linux environment. My target GPU is Fujitsu ruby MB86298 . To optimize the performance I have decided to use the VBO concept. I am very new to VBOs. I rendered basic primitives like triangle and quads using VBO where I have less no vertices . For rendering crown using a VBO, I computed all the vertices(more than 200). Now I am finding difficulty in sending this data of 200 vertices to the VBO.I cannot manually enter the all the vertex data and store in an array and pass it to VBO. Is there any way to send that vertex data of each for loop( used

Perspective correct texturing of trapezoid in OpenGL ES 2.0

橙三吉。 提交于 2019-11-26 20:24:46
I have drawn a textured trapezoid, however the result does not appear as I had intended. Instead of appearing as a single unbroken quadrilateral, a discontinuity occurs at the diagonal line where its two comprising triangles meet. This illustration demonstrates the issue: (Note: the last image is not intended to be a 100% faithful representation, but it should get the point across.) The trapezoid is being drawn using GL_TRIANGLE_STRIP in OpenGL ES 2.0 (on an iPhone). It's being drawn completely facing the screen, and is not being tilted (i.e. that's not a 3D sketch you're seeing!) I have come

Is discard bad for program performance in OpenGL?

元气小坏坏 提交于 2019-11-26 19:44:30
问题 I was reading this article, and the author writes: Here's how to write high-performance applications on every platform in two easy steps: [...] Follow best practices. In the case of Android and OpenGL, this includes things like "batch draw calls", "don't use discard in fragment shaders", and so on. I have never before heard that discard would have a bad impact on performance or such, and have been using it to avoid blending when a detailed alpha hasn't been necessary. Could someone please

OpenGL ES 2.0 to Video on iPad/iPhone

你离开我真会死。 提交于 2019-11-26 19:38:48
问题 I am at my wits end here despite the good information here on StackOverflow... I am trying to write an OpenGL renderbuffer to a video on the iPad 2 (using iOS 4.3). This is more exactly what I am attempting: A) set up an AVAssetWriterInputPixelBufferAdaptor create an AVAssetWriter that points to a video file set up an AVAssetWriterInput with appropriate settings set up an AVAssetWriterInputPixelBufferAdaptor to add data to the video file B) write data to a video file using that

Explicit vs Automatic attribute location binding for OpenGL shaders

倾然丶 夕夏残阳落幕 提交于 2019-11-26 19:22:42
When setting up attribute locations for an OpenGL shader program, you are faced with two options: glBindAttribLocation() before linking to explicitly define an attribute location. or glGetAttribLocation() after linking to obtain an automatically assigned attribute location. What is the utility for using one over the other? And which one, if any, is preferred in practice? Kos I know one good reason to prefer explicit location definition. Consider that you hold your geometry data in Vertex Array Objects. For a given object, you create a VAO in such way that the indices correspond to, for example

Drawing a border on a 2d polygon with a fragment shader

大城市里の小女人 提交于 2019-11-26 19:20:02
问题 I have some simple polygons (fewer than 20 vertices) rendering flat on a simple xy plane, using GL_TRIANGLES and a flat color, a 2d simulation. I would like to add a border of variable thickness and a different color to these polygons. I have something implemented using the same vertices and glLineWidth/GL_LINE_LOOP, which works, but is another rendering pass and repeats all the vertex transforms. I think I should be able to do this in the fragment shader using gl_FragCoord and the vertex

iOS CVImageBuffer distorted from AVCaptureSessionDataOutput with AVCaptureSessionPresetPhoto

拜拜、爱过 提交于 2019-11-26 19:03:31
问题 At a high level, I created an app that lets a user point his or her iPhone camera around and see video frames that have been processed with visual effects. Additionally, the user can tap a button to take a freeze-frame of the current preview as a high-resolution photo that is saved in their iPhone library. To do this, the app follows this procedure: 1) Create an AVCaptureSession captureSession = [[AVCaptureSession alloc] init]; [captureSession setSessionPreset:AVCaptureSessionPreset640x480];

Appropriate multiplication of matrices for rotation/translation

我的梦境 提交于 2019-11-26 17:57:25
In order to rotate/translate object (rotation only about z-axis and translation only in xy plane) not just w.r.t to global center (device center) but also w.r.t other arbitrary points, I created an algorithm, which is correct (because all senior coders I have discussed with consider it correct), but it is taking a lot of time to remove an undesired translation in the implementation (algorithm was created on August 4 and was implemented on the same day, since then the code has been revised 15 times). Here is the implementation http://www.pixdip.com/opengles/transform.php#ALGO1 The lines of code

Is there a way to check if Android device supports openGL ES 2.0?

假如想象 提交于 2019-11-26 15:59:28
问题 I need to check dynamically if the used device supports openGL ES 2.0. How can i do that? 回答1: Yes. The following code will do the trick: final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo(); final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000; Read this for more info: http://www.learnopengles.com/android-lesson-one-getting-started/ You