opengl-es

Use opengl es to render video to SurfaceView but concerned about more overhead

南笙酒味 提交于 2019-12-23 04:55:21
问题 I wrote a video play view, it is a SurfaceView with a MediaPlayer instance. I attached the mediaplayer to the surface holder when surface created then start the play. This is easy and everyone knows the details. But I want to draw a bitmap which is the first frame of the video to the surfaceview.Canvas is not a choice to draw the bitmap, because it will disable the mediaplayer to connect. Since api level 14, we can new a surface with surfacetexture. So we can use opengl es to draw video frame

Picking objects in Android OpenGL ES using colors does not retrieve correct colors

允我心安 提交于 2019-12-23 04:49:24
问题 I am very new to OpenGL and I'm doing a very simple program to check if I can pick objects rendered on the screen, drawing each one with a unique color. So far, I render 2 flat squares and one triangle. The problem is that when the user touches the polygons, I get a color different from black, but the color index is the same for the three objects (when it should be different). Here is my code: The onDrawFrame method (within my Renderer). Here is where I render the polygons with an unique

OpenGLES 1.1 with FrameBuffer / ColorBuffer / DepthBuffer for Android with NDK r7b

不打扰是莪最后的温柔 提交于 2019-12-23 04:32:44
问题 After reading over the NDK docs and all my books on OpenGLES ive hit a wall. I am trying to copy my iOS OpenGLES set up to Android NDK R7 and above, mainly to get the depth buffer i overlooked earlier on when coding. The problem is i loose the textures on some objects when i enable the color buffer as seen below and the depth buffer isn't working when i send objects into the background. I am using OGLES 1.1 FFP and NDK R7 or above Here is my initialization code :- int32_t ES1Renderer:

How to show camera preview by opengl

假如想象 提交于 2019-12-23 03:47:10
问题 I want to show camera preview by SurfaceTexture. I have read this sample and it work well:: Modifying camera output using SurfaceTexture and OpenGL Now I want to do some process to the preview frames, how to get the data and push to the texture? 回答1: There are two ways to use opengl to show this pixels data Using Opengl in JAVA Using opengl in c or c++ ( JNI ) Actually, either way, It is going to be easy if you know what opengl pipeline is I alway use opengl with c++ because of reusability

Ripple Effect on the touch event UIImageView

烂漫一生 提交于 2019-12-23 03:41:12
问题 I want to make a ripple effect on a UIImageView upon receiving the user touch. How can i do this. Opengl is a good option. But on which part of opengl should i need to concentrate. I am new to opengl. 回答1: I'd suggest you check out cocos2d: http://www.cocos2d-iphone.org/ https://github.com/cocos2d/cocos2d-iphone It has a built-in ripple effect. There is sample code in their source under /tests/EffectsTest.m 来源: https://stackoverflow.com/questions/6353403/ripple-effect-on-the-touch-event

How to render a mesh behind another mesh, like a mask?

空扰寡人 提交于 2019-12-23 03:25:16
问题 I would like it so that when mesh A (the character), is behind mesh B (a wall), it is still rendered but with a solid gray color. I'm beginning opengles 2.0 and I'm still unsure as to go about this. From what I understand the depth buffer allows meshes to fight out who will be seen in the fragments they encompass, also there are various blend functions that could possibly involved in this, finally the stencil buffer looks like it would also have this desirable functionality. So is there a way

Implementing depth testing for semi-transparent objects

ε祈祈猫儿з 提交于 2019-12-23 03:03:22
问题 I've been carefully trolling the internet for the past two days to understand depth testing for semi-transparent objects. I've read multiple papers/tutorials on the subject and in theory I believe I understand how it works. However none of them give me actual example code. I have three requirements for my depth testing of semi-transparent objects: It should be order independant. It should work if two quads of the same objects are intersection each other. Both semi-transparent. Imagine a grass

Android camera preview on SurfaceTexture

依然范特西╮ 提交于 2019-12-23 02:53:44
问题 This is my scenario: I am trying to take a picture from the front camera when someone puts in the incorrect password in the lock screen. Basically, I need to be able to take a picture out of the front cam without a preview. After much googling, I figured out that the way to do it is opengl and SurfaceTexture. You direct the camera preview to a SurfaceTexture, and later extract the picture from this texture somehow. I found this out from the following resources: https://stackoverflow.com/a

Loading 3D objects and textures for OpenGL ES rendering

那年仲夏 提交于 2019-12-23 02:53:42
问题 I have some 3D objects stored in 3D editor application specific (Blender/Solid/3DS) file format exported to OBJ+MTL files with optional textures in PNG/JPG files. I would like to load these objects in OpenGL ES application on mobile phone (today for Android and in the near future for iOS too). And I don't want to write my own OBJ+MTL (or any other 3D format) parser. So I would like to use some 3D engine with support for loading 3D models (from OBJ+MTL or exported to 3D engine specific header

OpenGL ES Pixel Art - Scaling

血红的双手。 提交于 2019-12-23 02:50:31
问题 Im having trouble displaying pixel based art (think retro tiles and art) on OpenGL Es 1.1 on the iPhones. Tiles are represented using 8bytes (1 byte for each row) with each bit representing a pixel being set or not. For example a tile with the number 8: 0 0 0 0 0 0 0 0 -> 0 0 1 1 1 0 0 0 -> xxx 0 1 0 0 0 1 0 0 -> x x 0 1 0 0 0 1 0 0 -> x x 0 0 1 1 1 0 0 0 -> xxx 0 1 0 0 0 1 0 0 -> x x 0 1 0 0 0 1 0 0 -> x x 0 0 1 1 1 0 0 0 -> xxx Converting this to OpenGL on iPhone using glDrawArrays(GL