opengl-es

Receive frames from MediaCodec, edit and show on the glSurfaceView

瘦欲@ 提交于 2019-12-13 05:25:38
问题 What I'm working on is an application which can get frames then modify it (like move pixels in the frame). After that show the edited frames onto the screen with good speed, glSurfaceView will do that part I think. And MediaCodec will help getting the frames. I'm trying a good example about MediaCodec like ExtractMpegFramesTest from http://bigflake.com/mediacodec/. Can I directly edit the received frames with GLES code and show it onto the screen without getting Bitmap ? 来源: https:/

Android opengles animated text logic?

此生再无相见时 提交于 2019-12-13 05:18:13
问题 I have gotten text to render using opengl es on android and currently am trying to find out how to "animate" it like in pokemon games where it "reveals" the characters from left to right at a certain speed. How is this done? 回答1: Basically, this "text-sliding-in" is like all other animations. For example, look at this sample code: public class GameObject { // Each element in this char array contains // a single character, representing a serie of text. private char[] mText; // Frames before a

OpenGL ES 2.0 Android - Color Picking

六眼飞鱼酱① 提交于 2019-12-13 05:05:18
问题 I'm trying to implement color picking using GLES20.glReadPixels function in android OpenGL ES. The problem is that this function is always returning 0,0,0,0 as color and not the correct color values. Any idea why? My code looks like this: public boolean onTouchEvent(MotionEvent event) { if (event != null) { float x = event.getX(); float y = event.getY(); if (event.getAction() == MotionEvent.ACTION_UP) { int newX = (int)x; int newY = (int)y; ByteBuffer pixel = ByteBuffer.allocate(4); pixel

OpenGL ES 1.1 is it possible to have both - vertexColors AND lighting?

瘦欲@ 提交于 2019-12-13 04:58:12
问题 If I have a mesh that uses vertexColors and then enable GL_LIGHTING, then the vertexColors will be ignored and replaced by the calculated lighting. Is there a way in OpenGL ES 1.1 to have both at the same time - vertex colors & dynamic lighting? thanks! 回答1: You can use glEnable(GL_COLOR_MATERIAL); to have the material parameters track the current color. On desktop OpenGL implementations there is also glColorMaterial to configure if the color is to be applied as the ambient of diffuse value,

Seekbar progress changed but GLSurface view not affected

谁说我不能喝 提交于 2019-12-13 04:57:32
问题 I am developing app in which i want to give brightness to my GLsurfaceView on progress changed of Seekbar. The progress changed but GLsurfaceView can't be effected means i can't increment or decrement brightness eventhough color are also not applied to GLSurfaceview.. I have tried for that. But nothing happen. Appropriate for your help Thanks in Advance!! My Code is Here: EffectActivity.java: public class EffectsActivity extends FragmentActivity implements OnTouchListener, OnClickListener,

how to get texture in webgl?without Canvas.toDataUrl()

我们两清 提交于 2019-12-13 04:49:00
问题 I want to get texture from webgl just like i can use getImageData() when the canvas context is 2d. how can i get texture form webgl context? 回答1: I know three possibilities. Important! For all these methods you must set preserveDrawingBuffer = true with webgl. To data url First one is high level method toDataURL and its origin is javascript canvas.toDataURL(type, encoderOptions); You can use this for example if you want to allow your client to do some app "screenshot" Following two methods

Writing to gl_FragColor causes glUseProgram to throw GL_INVALID_OPERATION

◇◆丶佛笑我妖孽 提交于 2019-12-13 04:28:47
问题 I'm trying to write a blur filter in GLSL ES 2.0 and I'm getting an Error with the line assigning gl_FragColor. I've not been able to figure out why #extension GL_OES_EGL_image_external : require precision mediump float; varying vec2 textureCoordinate; uniform samplerExternalOES s_texture; void main() { float gaus[25] = float[25](0.01739, 0.03478, 0.04347, 0.03478, 0.01739, 0.03478, 0.07282, 0.10434, 0.07282, 0.03478, 0.04347, 0.10434, 0.13043, 0.10434, 0.04347, 0.03478, 0.07282, 0.10434, 0

How to use dispatch_async in glkview?

故事扮演 提交于 2019-12-13 04:22:05
问题 I'm learning how to use threading with my iOS Opengl-es app. i tried to modify the opengl game template code: - (void)glkView:(GLKView *)view drawInRect:(CGRect)rect { glClearColor(0.65f, 0.65f, 0.65f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glBindVertexArrayOES(_vertexArray); // Render the object with GLKit [self.effect prepareToDraw]; glDrawArrays(GL_TRIANGLES, 0, 36); dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ sleep(1); dispatch

Open GL ES error: undefined reference to 'glDispatchCompute'

时光怂恿深爱的人放手 提交于 2019-12-13 04:11:50
问题 I am using Open GL ES 3.1 in Android app with native C++ code. So I need to run a C++ lib with Android support. I have used some Open GL ES functions and they worked well. But when I tried to use glDispatchCompute , a linker gave a following error: undefined reference to 'glDispatchCompute' . Here is the call: glDispatchCompute(10, 1, 1); Here are my includes: #include <string> #include <jni.h> #include <GLES3/gl31.h> #include <GLES/egl.h> #include <GLES/gl.h> #include <GLES3/gl3ext.h>

Does openGL ES have trouble displaying text?

狂风中的少年 提交于 2019-12-13 04:06:50
问题 Someone told me that openGL is for graphic only, and that it's very bad at displaying good readable text. Is that true for openGL ES on iPhone OS? 回答1: You can render any of the iPhone fonts into a texture and if it's displayed one-to-one, it looks beautiful. 来源: https://stackoverflow.com/questions/1132360/does-opengl-es-have-trouble-displaying-text