opengl-es

SurfaceView or TextureView combination

岁酱吖の 提交于 2019-12-06 05:51:12
I am trying to apply real-time effects to camera preview and show in multiple views , how can I do? (just like the camera2 ) ( snapshot ) I know 2 approaches to show real-time effects on camera preivew if no ScrollView involved on the left side. Use GLSurfaceView and setRenderer . Bind SurfaceTexture as GLES external texture, and use GLSL(OpenGL Shading Language) to apply effects. Use TextureView . It is more complex because need to setup EGLContext/EGLSurface and do thread management. However, I don't know how to make ScrollView with real-time effect items overlay GLES composition. Should I

Converting glReadBuffer() / glDrawBuffer() calls into OpenGL ES

牧云@^-^@ 提交于 2019-12-06 05:35:48
I'm having trouble understanding how to port glReadBuffer() & glDrawBuffer() calls into Open GL ES 1.1. Various forum posts on the internet just say "use VBOs," without going into more depth. Can you please help me understand an appropriate conversion? Say I have: glReadBuffer(GL_FRONT); followed by glDrawBuffer(GL_BACK_LEFT); state->paint(state_id, f); How can I write the pixels out? glReadBuffer and glDrawBuffer just set the source and target for subsequent drawing operations. Assuming you're targeting a monoscopic device, such as the iPhone or an Android device, and have requested two

Android OpenGL weirdness with the setLookAtM method

陌路散爱 提交于 2019-12-06 05:24:51
问题 As a beginner to android and openGL 2.0 es, I'm testing simple things and see how it goes. I downloaded the sample at http://developer.android.com/training/graphics/opengl/touch.html . I changed the code to check if I could animate a rotation of the camera around the (0,0,0) point, the center of the square. So i did this: public void onDrawFrame(GL10 unused) { // Draw background color GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); // Set the camera position (View matrix) long time = SystemClock

GLES20 Texture Not Working on Some Devices

偶尔善良 提交于 2019-12-06 05:05:12
I have tried to add a fairly simple extension on top of Android's example OpenGL 2.0 project in order to add texturing to basic shapes. This seems pretty straightforward, but on certain devices (Samsung Nexus S, LG Optimus 3D, Samsung Galaxy S) the texture just does not render. This is actually a problem that I am having on a much larger project, but I was able to reproduce the issue with the simple project below in the hope that someone here has an idea of where my code presents issues, or how to specifically architect GL textures for these devices (maybe there are issues with the devices).

Read pixels from off-screen OpenGL pixel buffer in iOS (OopenGL-ES)

寵の児 提交于 2019-12-06 05:03:07
问题 I want to read pixels from an off-screen (not backed by a CAEAGLLayer) Framebuffer. My code to create the buffer looks like: glGenFramebuffersOES(1, &_storeFramebuffer); glGenRenderbuffersOES(1, &_storeRenderbuffer); glBindFramebufferOES(GL_FRAMEBUFFER_OES, _storeFramebuffer); glBindRenderbufferOES(GL_RENDERBUFFER_OES, _storeRenderbuffer); glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, _storeRenderbuffer); glRenderbufferStorageOES(GL

Android OpenGL image processing - without SurfaceView

我怕爱的太早我们不能终老 提交于 2019-12-06 05:01:59
问题 I want to do some background image processing using OpenGL ES 2 and shaders, but no drawing to a surface (i.e. off-screen rendering to framebuffers only). While I've already done so on iOS, I'm struggling with this on Android. I think I'm close to creating a working OpenGL context, but haven't figured out how to do so without a SurfaceView. 回答1: Have a look at this gamedev post (click on expand to view the complete code). The code creates a GL context and uses the GLSurfaceView.Renderer

Difference between OpenGL SL and OpenGL ES 2.0 SL

被刻印的时光 ゝ 提交于 2019-12-06 04:57:48
问题 I need to write opengl-based application for Android. Is there a big difference between OpenGL SL and OpenGL ES 2.0 SL and between OpenGL and OpenGL ES and will it be useful if I learn OpenGL and GLSL using some books related to general OpenGL, not to OpenGL ES? 回答1: There are some huge differences between GLSL on a desktop environment and GLSL in OpenGL ES 2.0. The primary difference would be the introduction of precision to integer and floating-point types. Implementations are required to

High-performance copying of RGB pixel data to the screen in iOS

Deadly 提交于 2019-12-06 04:47:39
Our product contains a kind of software image decoder that essentially produces full-frame pixel data that needs to be rapidly copied the screen (we're running on iOS). Currently we're using CGBitmapContextCreate and we access the memory buffer directly, then for each frame we call CGBitmapContextCreateImage, and then draw that bitmap to the screen. This is WAY too slow for full-screen refreshes on the iPad's retina display at a decent framerate (but it was okay for non-Retina-devices). We've tried all kinds of OpenGL ES-based approaches, including the use of glTexImage2D and glTexSubImage2D

Glitch when moving camera in OpenGL

旧时模样 提交于 2019-12-06 04:47:25
问题 I am writing a tile-based game engine for the iPhone and it works in general apart from the following glitch. Basically, the camera will always keep the player in the centre of the screen, and it moves to follow the player correctly and draws everything correctly when stationary. However whilst the player is moving, the tiles of the surface the player is walking on glitch as shown: http://img41.imageshack.us/img41/9422/movingy.png Compared to the stationary (correct): http://img689.imageshack

Multi-pass shaders in OpenGL ES 2.0

大兔子大兔子 提交于 2019-12-06 04:45:33
问题 First - Does subroutines require GLSL 4.0+? So it unavailable in GLSL version of OpenGL ES 2.0? I quite understand what multi-pass shaders are. Well what is my picture: Draw group of something (e.g. sprites) to FBO using some shader. Think of FBO as big texture for big screen sized quad and use another shader, which, for example, turn texture colors to grayscale. Draw FBO textured quad to screen with grayscaled colors. Or is this called else? So multi-pass = use another shader output to