opengl-es-2.0

what is wrong when i use Eglimage replace glreadpixels in NDK program?

半世苍凉 提交于 2019-11-27 06:19:32
问题 //step 2. Create the Android Graphic Buffer GraphicBuffer* buffer = new GraphicBuffer(w, h, HAL_PIXEL_FORMAT_RGBA_8888, GraphicBuffer::USAGE_HW_TEXTURE | GraphicBuffer::USAGE_HW_2D | GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN); // Init the buffer status_t err = buffer->initCheck(); if (err != NO_ERROR) { LOGE("Error: %s\n", strerror(-err)); return ; } // Retrieve andorid native buffer android_native_buffer_t* anb = buffer->getNativeBuffer(); //step 3. Create the EGLImage const

OpenGL ES 2.0 Object Picking on iOS

ぐ巨炮叔叔 提交于 2019-11-27 04:03:19
问题 What is the best method to select objects that have been drawn in OpenGL ES 2.0 (iOS)? I am drawing points. 回答1: Here is working prototype of color picking, tested on most old ipads and working well. This is actually some part of project called InCube Chess that one may find in app store. The main code you will see is located in a class derived from GLKViewController like this: @interface IncubeViewController : GLKViewController This means you have glkview in it: ((GLKView *)self.view). Here

How to render Android's YUV-NV21 camera image on the background in libgdx with OpenGLES 2.0 in real-time?

橙三吉。 提交于 2019-11-27 02:53:13
Unlike Android, I'm relatively new to GL/libgdx. The task I need to solve, namely rendering the Android camera's YUV-NV21 preview image to the screen background inside libgdx in real time is multi-faceted. Here are the main concerns: Android camera's preview image is only guaranteed to be in the YUV-NV21 space (and in the similar YV12 space where U and V channels are not interleaved but grouped). Assuming that most modern devices will provide implicit RGB conversion is VERY wrong, e.g the newest Samsung Note 10.1 2014 version only provides the YUV formats. Since nothing can be drawn to the

What is the maximum texture size available on the iPad?

左心房为你撑大大i 提交于 2019-11-27 01:58:04
问题 Anyone know the maximum texture size for the iPad? I'm having trouble finding numbers for this. 回答1: The iPad 2 supports OpenGL ES 2.0 and 2048 x 2048 textures. http://developer.apple.com/iphone/library/documentation/General/Conceptual/iPadProgrammingGuide/AboutThePlatform/AboutThePlatform.html 回答2: As a supplement to the accepted answer: 2048 was the maximum for iPad2 as well, up until iOS5.1, when it became 4096. 4096 is the maximum for iPad3, as pointed out by @badweasel in the comments.

OpenGL ES Android Matrix Transformations

别来无恙 提交于 2019-11-27 01:41:04
问题 I have a renderer implementing GLSurfaceView.Renderer interface; a subclass of GLSurfaceView and some classes representing my objects I want to draw. I have the code from http://developer.android.com/training/graphics/opengl/motion.html I want to expand this and add some moving along axes and can't manage it. The object is only rotated. and here is my code: public class NotMyCoolRenderer implements GLSurfaceView.Renderer { public GLShip mTriangle; private GLBackgroundStar mSquare; private

Is it possible to draw line thickness in a fragment shader?

一曲冷凌霜 提交于 2019-11-27 00:30:18
问题 Is it possible for me to add line thickness in the fragment shader considering that I draw the line with GL_LINES? Most of the examples I saw seem to access only the texels within the primitive in the fragment shader and a line thickness shader would need to write to texels outside the line primitive to obtain the thickness. If it is possible however, a very small, basic, example, would be great. 回答1: Quite a lot is possible with fragment shaders. Just look what some guys are doing. I'm far

How to draw a texture as a 2D background in OpenGL ES 2.0?

≡放荡痞女 提交于 2019-11-27 00:13:47
问题 I'm just getting started with OpenGL ES 2.0, what I'd like to do is create some simple 2D output. Given a resolution of 480x800, how can I draw a background texture? [My development environment is Java / Android, so examples directly relating to that would be best, but other languages would be fine.] 回答1: Even though you're on Android, I created an iPhone sample application that does this for frames of video coming in. You can download the code for this sample from here. I have a writeup

How can I do these image processing tasks using OpenGL ES 2.0 shaders?

一世执手 提交于 2019-11-26 23:30:42
How can I perform the following image processing tasks using OpenGL ES 2.0 shaders? Colorspace transform ( RGB/YUV/HSL/Lab ) Swirling of the image Converting to a sketch Converting to an oil painting I just added filters to my open source GPUImage framework that perform three of the four processing tasks you describe (swirling, sketch filtering, and converting to an oil painting). While I don't yet have colorspace transforms as filters, I do have the ability to apply a matrix to transform colors. As examples of these filters in action, here is a sepia tone color conversion: a swirl distortion:

How to save SurfaceTexture as bitmap

断了今生、忘了曾经 提交于 2019-11-26 23:22:46
问题 When I decode a video to a surface I want to save the frames i want as bitmap/jpeg files. I don't want to draw on the screen and just want to save the content of the SurfaceTexture as an image file. 回答1: You have to render the texture. If it were a normal texture, and you were using GLES 2 or later, you could attach it to an FBO and read directly from that. A SurfaceTexture is backed by an "external texture", and might be in a format that the GL driver doesn't support a full set of operations

Android OpenGL ES 2.0 emulator

南楼画角 提交于 2019-11-26 22:41:34
Well i have a device which supports OpenGl ES 2.0 (HTC Desire), and of course deploy app on device much faster then on emulator. Default android emulator does not support 2.0, androidX86 project and similiar androbox project does not support native code (NDK) so even Hello-Jni crash on them (all samples works fine on standart AVD except Hello-GL2 sample ofc), don't know supports they a OpenGL ES 2.0 or not, please tell me. So if there is a development in native way (NDK) with OpenGl 2.0 support - how is possible to test app without device? Update: As correctly stated by a StackOverflow user,