opengl-es-2.0

Release textures (GLKTextureInfo objects) allocated by GLKTextureLoader

旧巷老猫 提交于 2019-11-29 02:55:07
问题 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

How to load and display .obj file in Android with OpenGL-ES 2

喜你入骨 提交于 2019-11-29 02:51:54
问题 I am trying to load an .obj file into my Android application and display it using OpenGL 2. You can find the file here: EDIT: I removed the file , you can use any .obj file that contains the values mentiones below for testing. There are a lot of similar questions on stackoverflow but I did not find a simple solution that does not require some large library. The file only contains the following value types: g v vt vn f I tried libgdx, which worked ok, but it is a bit overkill for what I need.

GLSL for simple water surface effects

北慕城南 提交于 2019-11-29 02:49:50
问题 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? 回答1: 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,

How do I render a triangle in QOpenGLWidget?

穿精又带淫゛_ 提交于 2019-11-29 02:48:29
问题 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

OpenGL ES 2.0 texture distortion on large geometry GL_REPEAT

浪尽此生 提交于 2019-11-29 02:28:44
OpenGL ES 2.0 has serious precision issues with texture sampling - I've seen topics with a similar problem , but I haven't seen a real solution to this "distorted OpenGL ES 2.0 texture" problem yet. This is not related to the texture's image format or OpenGL color buffers, it seems like it's a precision error. I don't know what specifically causes the precision to fail - it doesn't seem like it's just the size of geometry that causes this distortion, because simply scaling vertex position passed to the the vertex shader does not solve the issue. Here are some examples of the texture distortion

iOS and multiple OpenGL views

感情迁移 提交于 2019-11-29 00:37:37
I'm currently developping an iPad app which is using OpenGL to draw some very simple (no more than 1000 or 2000 vertices) rotating models in multiple OpenGL views. There are currently 6 view in a grid, each one running its own display link to update the drawing. Due to the simplicity of the models, it's by far the simplest method to do it, I don't have the time to code a full OpenGL interface. Currently, it's doing well performance-wise, but there are some annoying glitches. The first 3 OpenGL views display without problems, and the last 3 only display a few triangles (while still retaining

CVOpenGLESTextureCacheCreateTextureFromImage returns error 6683

人走茶凉 提交于 2019-11-29 00:09:55
I am currently attempting to draw an image in openGL using YUV420 format (bi-planar). I receive raw data, and am attempting to parse it into a CVPixelBuffer, and then pass said buffer using CVOpenGLESTextureCacheCreateTextureFromImage. While I receive no errors when parsing into the CVPixelBuffer, I receive an error (-6683) when trying to pass into CVOpenGLESTextureCacheCreateTextureFromImage. I'm trying my best to follow apple's GLCameraRipple sample code - except again, I'm using raw image data instead of data from the camera. Hopefully someone can explain what it is that I'm missing here -

OpenGL ES 2.0 render to texture

岁酱吖の 提交于 2019-11-28 23:31:32
I'm trying to render to a texture using OpenGL ES 2.0, but I can't seem to make it work. This is how I proceed: struct RenderTexture { GLuint framebuffer; GLuint tex; GLint old_fbo; RenderTexture(GLuint width, GLuint height) { glGetIntegerv(GL_FRAMEBUFFER_BINDING, &old_fbo); glGenFramebuffers(1, &framebuffer); glGenTextures(1, &tex); glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); glBindTexture(GL_TEXTURE_2D, tex); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0);

Antialiasing in OpenGL ES 2.0?

半世苍凉 提交于 2019-11-28 22:04:19
Is there a way to implement Anitaliasing technique in OpenGL ES 2.0 ? I have goggled and found few methods but there was no change in the output. In the worst case I've planned to implement multiple pass rendering, to smooth the edges in fragment shader, by displaying average colour of the pixels around every pixel, but it costs more GPU performance. Any suggestions ? Reto Koradi A lot of devices support MSAA (Multi-Sample Anti-Aliasing). To take advantage of this feature, you have to choose a EGLConfig that has multisampling. On Android, if you use GLSurfaceView , you will have to implement

Repeating OpenGL-es texture bound to hills in cocos2d 2.0

人盡茶涼 提交于 2019-11-28 20:45:22
ORIGINAL ARTICLE I am in the process of trying to implement raywenderlich's tutorial on generating hills with repeating striped coordinates using cocos2d, This article was written for Cocos2D 1.0, and as I am trying to port it to Cocos2D 2.0 This means updating it for openGl-es 2. So far everything has worked perfectly, However I am having problems with getting the texture of the hill to repeat properly... Here is my code: Sending the hills the texture: CCSprite *stripes = [self stripedSpriteWithColor1:color3 color2:color4 textureSize:512 stripes:nStripes]; stripes.position = ccp(winSize.width