opengl-es-2.0

OpenGL ES 2.0 Camera Issues

时光总嘲笑我的痴心妄想 提交于 2019-11-30 05:49:36
问题 I'm working with Android and OpenGL ES 2.0 and I am having an issue that I can't really formulate into a solid question. In the image, http://i.imgur.com/XuCHF.png, I basically have a shape to represent a ship in the middle and when it's moved to the side it gets stretched toward the vanishing point. What I am wanting to accomplish is to have the ship maintain most of its shape when it is moved. I believe it may be due to my matrices but every resource I've looked seems to use the same method

OpenGL ES depth buffer android, can't get to work

萝らか妹 提交于 2019-11-30 05:42:35
问题 I'm unable to get the depth buffer working correctly on Android OpenGL ES 2.0. Regardless of what I do, the objects are always render in the order provided and completely ignore the depth buffer. From what I've read, the default setup should have a depth buffer, but I've nonetheless tried every function I could think of to get it working: //setup setEGLContextClientVersion(2); setEGLConfigChooser( true ); GLES20.glEnable( GLES20.GL_DEPTH_TEST ); GLES20.glDepthFunc( GLES20.GL_LEQUAL ); GLES20

Release textures (GLKTextureInfo objects) allocated by GLKTextureLoader

时间秒杀一切 提交于 2019-11-30 05:21:35
New to developing on iOS and in particular the new OpenGL related features on iOS 5, so I apologize if any of my questions are so basic. The app I am working on is designed to receive camera frames and display them on screen via OpenGL ES (the graphic folks will take over this and add the actual OpenGL drawing about which I know very little). The application is developed XCode4, and the target is iPhone4 running iOS 5. For the moment, I used the ARC and the GLKit functionality and all is working fine except for the memory leak in loading the images as texture. The app receives a "memory

How do I render a triangle in QOpenGLWidget?

自作多情 提交于 2019-11-30 05:07:30
I'm trying to use OpenGL inside of Qt using QOpenGLWidget, but I am having a hard time finding any relevant examples. I am new to OpenGL, so I am trying to learn how to use it, but the tutorials that I find don't seem to apply particularly well in QOpenGLWidget. Right now, all I want to do is render a triangle to start with. Here's what I have so far. Header: namespace Ui { class Widget; } class Widget : public QOpenGLWidget, protected QOpenGLFunctions { public: explicit Widget(QWidget *parent = 0); ~Widget(); protected: void initializeGL(); void resizeGL(int, int); void paintGL(); private: Ui

GLSL for simple water surface effects

限于喜欢 提交于 2019-11-30 05:04:36
I'm looking for some pointers on how to implement simple water surface effects in OpenGL ES 2.0. Nothing fancy like reflection or refraction, just a basic ripple/wave effect that modulates over time. Performance is critical. I'm assuming this will be best done in a shader. Any pointers on how to best handle this? There is an old trick to simulate water waves & ripples using minimum effort in terms of equations. It's used in many places, and I can't find the original, but you can grab it, for example, from here . You'll need 2 textures, each containing just height. Simulation is done by ping

Can I specify per face normal in OpenGL ES and achieve non-smooth/flat shading?

青春壹個敷衍的年華 提交于 2019-11-30 03:41:19
问题 I want to display mesh models in OpenGL ES 2.0, where it clearly shows the actual mesh, so I don't want smooth shading across each primitive/triangle. The only two options I can think about are Each triangle has its own set of normals, all perpendicular to the triangles surface (but then I guess I can't share vertices among the triangles with this option) Indicate triangle/primitive edges using black lines and stick to the normal way with shared vertices and one normal for each vertex Does it

What versions of GLSL can I use in OpenGL ES 2.0?

五迷三道 提交于 2019-11-30 03:30:19
I can't seem to find a clear answer on this, despite hours of googling. Can someone just tell me what's going on? I get errors saying things like, "version 140 is not supported." Is this my device (Kindle Fire) or GL ES 2.0? Do I need to add libraries or anything? you actually don't have to add any libraries, 140 is far too new for Kindle Fire. Either remove the version specification or decrement it until the shader compiles. You may need to fix some other errors in the shader as the individual versions of the language do have some differences. You can also query GL_SHADING_LANGUAGE_VERSION

Is it possible for a vertex attribute to be an array in GLSL-ES 2.0?

微笑、不失礼 提交于 2019-11-30 03:25:11
问题 In GLSL-ES it's possible to have arrays. For example, the GLSL ES Specification gives the following example of a uniform variable that's an array: uniform vec4 lightPosition[4]; Is it possible to have vertex attributes that are arrays? In other words, is the following legal according to the spec? attribute vec4 foo[3]; // three vec4s per vertex Is the answer (either yes or no) explicitly mentioned anywhere in the GLSL ES Specification? (I can't find it, but I haven't read every line of the

GLSurfaceView - how to make translucent background

只愿长相守 提交于 2019-11-30 02:45:45
问题 I try to render using GLSurfaceView, and by docs I set format: getHolder().setFormat(PixelFormat.TRANSLUCENT); The I use GLSurfaceView.Renderer, which draws in onDrawFrame: GLES20.glClearColor(0, 0, 1, .5f); GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); However, the GL rendering in GLSurfaceView is not translucent, and is fully blue. If I omit glClear call, then it's fully black. How do I make GL rendering to have transparent background, so that it is blended with

iOS 5 + GLKView: How to access pixel RGB data for colour-based vertex picking?

戏子无情 提交于 2019-11-30 00:58:08
I've been converting my own personal OGLES 2.0 framework to take advantage of the functionality added by the new iOS 5 framework GLKit . After pleasing results, I now wish to implement the colour-based picking mechanism described here . For this, you must access the back buffer to retrieve a touched pixel RGBA value, which is then used as a unique identifier for a vertex/primitive/display object. Of course, this requires temporary unique coloring of all vertices/primitives/display objects. I have two questions, and I'd be very grateful for assistance with either: I have access to a