opengl-es

Android OpenGL ES generate a circular mesh for texture

南楼画角 提交于 2019-12-07 12:59:43
问题 I'm new to OpenGL-ES on Android, and I have a question regarding generating a mesh for a texture that represents a circle. Desired mesh on the left, and my Texture on the right: How do i generate the mesh on the left? and then render it in the following way: triangle1{Centerpoint, WhitePoint, nextpointclockwise(say #1)}, triangle2{Centerpoint, point#1, nextpointclockwise(say #2)}, triangle3{Centerpoint, point#2, nextpointclockwise(say #3)} 回答1: This will create the vertices and texture

iOS OpenGL ES - Different texture behaviour on simulator and device

瘦欲@ 提交于 2019-12-07 12:55:19
问题 I'm loading textures using OpenGL ES, the below is my code. The graphic is made up of 2 textures of the same size, the stop button and the blue glow behind. The first graphic below was taken using the iPad simulator in xCode, and the 2nd on the actual device. The 1st graphic is the correct output as I exported the graphics from Illustrator. However, when I loaded the program on the iPad, it gives me the 2nd graphic. It seems somehow that the blue light texture behind the stop button has

Android MediaCodec output format: GLES External Texture (YUV / NV12) to GLES Texture (RGB)

坚强是说给别人听的谎言 提交于 2019-12-07 12:24:15
问题 I am currently trying to develop a video player on Android, but am struggling with color formats. Context: I extract and decode a video through the standard combinaison of MediaExtractor/MediaCodec . Because I need the extracted frames to be available as OpenGLES textures (RGB) , I setup my decoder ( MediaCodec ) so that it feeds an external GLES texture ( GL_TEXTURE_EXTERNAL_OES ) through a SurfaceTexture. I know the data output by my HW decoder is in the NV12 ( YUV420SemiPlanar ) format,

How can I access the raw pixel data of an opengl es 2 off screen render buffer?

半世苍凉 提交于 2019-12-07 12:08:35
问题 I can render to the screen but I would like to be able to access the raw pixels that have been rendered by the shader. The only way I know how is to use glReadPixels off of the screen, but I would like to access them before they are draw to screen in order to save frames to disk. Specifically I want to use shaders to process images that are never displayed: 1)grab image from disk 2)render it 3)output back to disk. 回答1: Have you tried to render to the offscreen texture as in here? 来源: https:/

iPhone OpenGL ES incorrect alpha blending

偶尔善良 提交于 2019-12-07 11:43:19
问题 I have a problem with incorrect alpha blending results with openGL ES on iPhone. This is my code for creating texture object: glGenTextures(1, &tex_name); glBindTexture(GL_TEXTURE_2D, tex_name); glTextImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex_width, tex_height, GL_RGBA, GL_UNSIGNED_BYTE, tex_data); 'tex_data' is loaded from raw RGBA8888 data packed with zlib. It loads as it should, wich i've checked with a debugger. This is my code for setting up texture before rendering: glEnable(GL_BLEND);

undefined reference glBindVertexArrayOES,glGenVertexArraysOES,glDeleteVertexArraysOES in eclipse

独自空忆成欢 提交于 2019-12-07 11:22:17
问题 Trying to compile C++ code with Android NDK but these errors wont go away undefined reference to glBindVertexArrayOES undefined reference to glGenVertexArraysOES undefined reference to glDeleteVertexArraysOES In .mk file wrote LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog -lz -landroid -lEGL All other function are found perfectly, do i need to declare anything to make these work? 回答1: This functions are not in base opengl es specification, so they are not defined by default, but offered as

Can anyone explain the way the “Khronos stack” of technologies fits together?

偶尔善良 提交于 2019-12-07 11:00:37
问题 I've been researching OpenGL, OpenGL-ES, etc...Can anyone explain to me, from the bottom up, how this all fits together? For instance, framebuffer -> ?? -> Window Manager -> OpenGL ? (That shows you where I'm at with this, sadly.) Or in the case of a workstation...video card -> DRI -> X -> WM -> ???? I've only recently started working on C++ stuff on personal projects...I've mainly worked on "business software" type stuff in the past...any help would be greatly appreciated! 回答1: There are

In opengl es 2, is there a way to prevent interpolation of varyings

半腔热情 提交于 2019-12-07 10:40:46
问题 In other words, emulating the old opengl flat shading model, so you could for example have a line strip where each segment is a distinct color rather than an interpolation of color across the segment? 回答1: Not directly. GLSL for Desktop has the flat keyword, but GLSL ES doesn't have it (it's reserved). A trick to emulate this behaviour is to assign the same color at each vertex in a triangle (or in a segment), so the interpolation is between the same value. 来源: https://stackoverflow.com

Create lightning in OpenGL ES 1.1

佐手、 提交于 2019-12-07 09:49:42
问题 I need to create good looking lightning using OpenGL ES 1.1 (iPhone) and was planning on using shaders. However, when I asked about it in a previous question (OpenGL ES 1.x Shaders) I was informed there that this was probably not an option on the iPhone. So now I am back at square one, wondering how I might make a lightning animation. It does not need to look ultra-realistic. I have already tried to use things like triangles stripped together. While this method does work, it is not as good as

Are OpenGL Textures more memory efficient than Android Bitmaps?

梦想的初衷 提交于 2019-12-07 09:33:49
问题 I have a custom map application that deals with many Bitmaps that are 256x256 images (png,jpg). I'm currently using the View 2d canvas and bring in all images as RGB_565. Although I'm generally happy with the applications performance, I have features I'd like to add that will require even more map tiles (Bitmaps). I've been thinking about using opengl but am fairly new to it. Would opengl Textures be more memory efficient than keeping Bitmaps around? I assume you can load a Bitmap into a