opengl-es

opengl - framebuffer texture clipped smaller than I set it?

谁说我不能喝 提交于 2020-01-15 03:40:12
问题 I'm using opengl ES 2.0 I'm using a framebuffer linked to a texture to compile an offscreen render (of some simplistic metaballs), and then I'm rendering that texture to the main back buffer. Everything is looking great except that the texture appears clipped, ie. it is not the full window dimensions (short of about 128 pixels on one axis). Here's a screenshot: http://tinypic.com/r/9telwg/7 Any ideas what could cause this? I read here to set glViewport to the size of the texture, but that

glDrawArrays crash with EXC_BAD_ACCESS

天大地大妈咪最大 提交于 2020-01-14 19:52:29
问题 I'm writing an iPhone application which uses UIView with a CAEAGLayer as its layer. Everything is fine and working apart from 1 small problem: sometimes it crashes with EXC_BAD_ACCESS and the following stack trace: [EAGLView draw] glDrawArrays_Exec PrepareToDraw DrawFramebufferMakeResident AttachmentMakeResident TextureMakeResident memmove it crashes on the line: glVertexPointer(3, GL_FLOAT, 0, vertexCoordinates); glTexCoordPointer(2, GL_FLOAT, 0, textureCoordinates); glBindTexture(GL_TEXTURE

Incorrect VBO for mesh: some triangles are connected and shouldn't [2D]

江枫思渺然 提交于 2020-01-14 18:48:50
问题 I'm generating my VBO with this code int SCREEN_WIDTH = 800; int SCREEN_HEIGHT = 480; int PIXEL_PER_VERTEX = 4; int CAVERN_TEXTURE_WIDTH = 1024; int CAVERN_TEXTURE_HEIGHT = 512; final int vertexCount = ((SCREEN_WIDTH / PIXEL_PER_VERTEX) +1 ) * 2; final float[] bufferDataLowerCave = new float[vertexCount * CavernBoundMesh.VERTEX_SIZE]; for(int i=0; i < vertexCount; i += 2) { bufferDataLowerCave[i * CavernBoundMesh.VERTEX_SIZE + CavernBoundMesh.VERTEX_INDEX_X] = PIXEL_PER_VERTEX * i / 2.f;

Incorrect VBO for mesh: some triangles are connected and shouldn't [2D]

谁都会走 提交于 2020-01-14 18:47:07
问题 I'm generating my VBO with this code int SCREEN_WIDTH = 800; int SCREEN_HEIGHT = 480; int PIXEL_PER_VERTEX = 4; int CAVERN_TEXTURE_WIDTH = 1024; int CAVERN_TEXTURE_HEIGHT = 512; final int vertexCount = ((SCREEN_WIDTH / PIXEL_PER_VERTEX) +1 ) * 2; final float[] bufferDataLowerCave = new float[vertexCount * CavernBoundMesh.VERTEX_SIZE]; for(int i=0; i < vertexCount; i += 2) { bufferDataLowerCave[i * CavernBoundMesh.VERTEX_SIZE + CavernBoundMesh.VERTEX_INDEX_X] = PIXEL_PER_VERTEX * i / 2.f;

android bitmap pixel format for glTexImage2D

妖精的绣舞 提交于 2020-01-14 14:49:07
问题 I'm trying to load textures to use with NDK OpenGL from Java with the Bitmap class. It works, but I'm having problems with the pixel format. First, in Java, I load a bitmap from the assets folder like this: Bitmap bitmap = BitmapFactory.decodeStream(amgr.open(path)); return bitmap.copy(Bitmap.Config.ARGB_8888, false); the bitmap config does not have an option for RGBA channel order. [JNI things happen here] Using GLES 1, I then buffer the texture like so: glTexImage2D(GL_TEXTURE_2D, 0, GL

android bitmap pixel format for glTexImage2D

倖福魔咒の 提交于 2020-01-14 14:49:06
问题 I'm trying to load textures to use with NDK OpenGL from Java with the Bitmap class. It works, but I'm having problems with the pixel format. First, in Java, I load a bitmap from the assets folder like this: Bitmap bitmap = BitmapFactory.decodeStream(amgr.open(path)); return bitmap.copy(Bitmap.Config.ARGB_8888, false); the bitmap config does not have an option for RGBA channel order. [JNI things happen here] Using GLES 1, I then buffer the texture like so: glTexImage2D(GL_TEXTURE_2D, 0, GL

Where is glGenBuffers in Qt5?

别等时光非礼了梦想. 提交于 2020-01-14 13:18:26
问题 I can't seem to find the glGenBuffer function in Qt5, my include list looks like #include <QtOpenGL/qgl.h> #include <QtOpenGL/qglbuffer.h> #include <QtOpenGL/qglcolormap.h> #include <QtOpenGL/qglframebufferobject.h> #include <QtOpenGL/qglfunctions.h> #include <QtOpenGL/qglpixelbuffer.h> #include <QtOpenGL/qglshaderprogram.h> #include <GL/GLU.h> I am trying to do something like the following example: http://qt-project.org/doc/qt-5.0/qtopengl/cube.html Where is it? 回答1: I know I'm late, but

LibGDX - Shader working on Desktop but not on Android

微笑、不失礼 提交于 2020-01-14 11:48:11
问题 I have written a simple program that renders a sphere in a 3d environment and colores it according to four light sources around the sphere. When I run the program on the desktop it works just fine but on an Android device the sphere is just plain colored. Here are images to illustrate what I am talking about: -> Desktop -> Android And here is the shader code: sphere.vert #ifdef GL_ES precision mediump float; #endif uniform mat4 u_projectionMatrix; uniform mat3 u_normalMatrix; uniform mat4 u

Curving/warping views with CoreAnimation or OpenGL for carousel effect

独自空忆成欢 提交于 2020-01-13 08:37:28
问题 Right now I'm populating a UIScrollView with a series of views. The views need to be warped to make the UIScrollView appear like a carousel. In other words when the user scrolls it needs to be like a circle. I've never done anything quite like this before, but I'm assuming CoreAnimation is out of the question and OpenGL needs to be used. If this is possible with CoreAnimation or Quartz then I really just need a sample on how to warp the views and I can figure the rest out myself but I'm not

Mapbox Web GL JS - querySourceFeatures() function with vector tile source

强颜欢笑 提交于 2020-01-13 06:31:26
问题 I've got a vector tileset on Mapbox that I created by uploading a geojson file comprising polygons representing particular suburbs in Victoria, Australia. My vector tileset has three properties - suburb, state, postcode - corresponding to the feature properties in the geojson. I can also successfully query those properties via the Mapbox web gl js library to get an accurate map. For example I've got a map working that shows a popup when I click a highlighted polygon, and the popup correctly