opengl-es

Image displayed with black background OPENGL ES Android

偶尔善良 提交于 2019-12-12 03:19:26
问题 Hi I am playing around with OPENGL Es on ANdroid and I am trying to display an image on my app. When I display the image ( image specs is 64x64 pixels ) I get a black background on the image but when I put this code: public void draw(GL10 gl) { ... .. gl.glAlphaFunc( GL10.GL_GREATER, 0 ); The black background disappears but I get strange colors in my image. Does anybody have an idea on how to fix this? 回答1: You need to use blending. Something like this should work: gl.glEnable(gl.GL_BLEND);

OpenGL ES how display off screen

荒凉一梦 提交于 2019-12-12 03:18:56
问题 I would like to apply some effects on the camera preview. In fact, I want to extend the upper half portion. Actually, I do it with the fragment shader but it's still in the off screen. So how can I translate the off screen in the screen after the process of my shader (translate y=1.5 to y=1.0)? I tried with a matrix but it displays a green square. explanation Thank you edit: Here is a simple example to describe my problem. To simplify, I want to make something in the off screen (during the

Android NDK, Opengl es 2, VBO crashes the render

只愿长相守 提交于 2019-12-12 03:09:47
问题 Ok this is the fourth time that I post this issue. It is a complicate problem, I know that. I'm going to explain all, beacuse I dont know what is important or not, and this problem looks like is something stupid in the code, that I don't realize. I had been developing a game engine for Android with the render part in c++ NDK, few days ago, I had no problem with this, I could see my game correctly in any android device, then, I wrote more code, updated Android Studio from 1.5.2 to 2.1.3,

GLTextureView create hole behind it

若如初见. 提交于 2019-12-12 02:59:28
问题 Hello I worked on a GLTextureView to display an alpha video, but because of the alpha channel I setted setEGLConfigChooser(8, 8, 8, 8, 16, 0); I tried a first time with a GLSurfaceView but the problem was that it needed a setZOrderOnTop(true) to show it and the view wasn't anymore attached to it's container (which is a zoomView). A TextureView is better but now I've my video in a hole rectangle on my container sadly! Source: wanted --[EDIT]-- Here some exemple : On top it's an GLSurfaceView

Android GLES20 works on bionic 4.1.2 but not on Samsung 4.4.2

懵懂的女人 提交于 2019-12-12 02:56:12
问题 I have an app that I'm working on that uses openGL ES 2.0 on an android device. The app contains some buttons that are displayed using programmatic layout controls. This button pad is superimposed on a OpenGl Surface View. When I run the app on the tablet the buttons appear but the Surface View is grey, the color of the background for the 3d model I've created. This leads me to believe there's something wrong with my shaders. I use many uniform vec2's in my fragment shader. I'm looking at

Android - How to know maximal size/dimensions of the image that the device can load

天大地大妈咪最大 提交于 2019-12-12 02:50:09
问题 My question may not be very correct, but let me describe it in details. I use cocos2d-x (renders using opengl-es 2) game engine to show images on Android device. In some cases when image dimensions are very large the images are not being displayed. They just get skipped. But I see that the size of the image is smaller then the size of my device VRAM. Checked with this method with /dev/graphics/fb0 : How to measure VRAM consumption on Android?. So my file size is 532,042 bytes , its dimension

Finding/Remapping bounds of OpenGL ES coordinate plane

試著忘記壹切 提交于 2019-12-12 02:47:27
问题 I'm trying to make 2D graphics for my Android app that consists of six thin rectangles that each take up about 1/6th of the screen in width and equal the screen's height. I'm not sure the right way to determine the bounds of the x and y OpenGL coordinate plane on screen. Eventually I will need to write logic that tests which of the 6 rectangles a touch event occurs in, so I have been trying to solve this problem by remapping OpenGL's coordinate plane into the device's screen coordinate plane

How to use depth texture with stencil, OpenGL ES 3.0

为君一笑 提交于 2019-12-12 02:38:00
问题 I have an application where I want to render depth to a texture using stencil mask. I try GL_DEPTH_STENCIL_OES: Creating texture: glGenFramebuffers(1, fbo); glBindFramebuffer(GL_FRAMEBUFFER, *fbo); glGenTextures(1, depthTexture); glBindTexture(GL_TEXTURE_2D, *depthTexture); // using combined format: depth + stencil glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_OES, w, h, 0, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR

Optimizing OpenGl Rotation of a 2D grayscale image on iphone

会有一股神秘感。 提交于 2019-12-12 02:33:25
问题 I am rotating an image on the iPhone. It is a full size grayscale image (3264 by 2448 on the 4s). OpenGl appears to be roughly twice as fast as core graphics by my measurements, running about 1.22 seconds as opposed to 2.6 seconds. But this is not fast enough for my needs, I need sub-second rotation, if it is possible. (If not, we go to Plan B which involves rotating a subsection of the image, which is more elegant perhaps but has it's own issues.) I should make clear that this only for

Android Mesh Render issue

江枫思渺然 提交于 2019-12-12 02:29:05
问题 This time i'm having an issue with the actual rendering of my model. I can load it all through the Libgdx loadObj() function, and render it using GL10_Triangles, however i keep getting missing triangles in my model (it seems like only half the models are being rendered). I've tried the old ObjLoad function (commented out) and also the different render styles but nothing seems to work. And yes I have checked the model in Blender and the model is complete without missing faces. See the print