opengl-es

surfaces got broken when object is far away in iphone

别来无恙 提交于 2020-01-07 04:23:07
问题 I am using the opengl es to display objects. when the object is near to the camera, everything is perfect. but if the objects are moved faraway from the camera, the surface of objects would break. The broken objects will be like: the code snippet of draw objects is: glVertexPointer(3, GL_FLOAT, 32, self.vertices); glNormalPointer(GL_FLOAT, 32, &(self.vertices[3])); glTexCoordPointer(2, GL_FLOAT, 32, &(self.vertices[6])); glDrawElements(GL_TRIANGLES, self.indexNumber, GL_UNSIGNED_SHORT, &(self

WebGL drawing failure after mouse click

家住魔仙堡 提交于 2020-01-07 03:58:47
问题 I have a helper method drawRect(p1, p2) that draws a rectangle (in orthographic projection). The code works fine if I do this: function webGLStart() { // initialization code gl.clear(gl.COLOR_BUFFER_BIT); gl.uniformMatrix4fv(shaderProgram.pMatrixLoc, false, pMatrix); drawRect(new Point(10, 10), new Point(50, 50)); } Now suppose I want to render a new rectangle after every mouse click. So I cleared the canvas, set up the projection matrix and moved the drawRect call in mouse down handler. And

Android. W/OpenGLRenderer: Bitmap too large to be uploaded into a texture

断了今生、忘了曾经 提交于 2020-01-07 03:51:09
问题 When I call Canvas.drawBitmap() for a Bitmap with more than 4096px on one side - I get nothing. No errors and no bitmap drawn. There appears only this message in LogCat: W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (2880x4920, max=4096x4096) This leads to these questions: What does the limit of 4096x4096 depend on? The Android version? The Kernel drivers? Or the Hardware? How can I check this limit at runtime for the current device? How can I catch the error "W

OpenGL stencil (Clip Entity)

核能气质少年 提交于 2020-01-06 19:49:24
问题 I am trying to use a sprite as clip-entity. This means I want that all it's child entities are clipped so that only the parts of the children that overlap the clip-entity (parent) are visible. I'm trying to do that using the OpenGL stencil function. On my emulator I got it working, but on my Android phone it doesn't. What am I doing wrong? GLES20.glEnable(GLES20.GL_STENCIL_TEST); GLES20.glClearStencil(0); GLES20.glStencilMask(1); GLES20.glClear(GLES20.GL_STENCIL_BUFFER_BIT); // pre draw

GLM on compile breeds a ton of errors

半腔热情 提交于 2020-01-06 19:46:12
问题 I include some GLM files into my code, and I receive a ton of errors (at least 90 of them). Why this is happening, I have no idea. I am using the latest GLM (0.9.3.3 at the time of this writing). I am also using Qt Creator on Windows, with a QMake file you'll see. I should also note that I ended up copying the glm folder to my include directory reciding in my mingw folder. What can I do to fix this? QMake CONFIG += console HEADERS += \ util.hpp \ ShaderComparable.hpp \ SearchTree.hpp \

adb screencap output is different than on the device

坚强是说给别人听的谎言 提交于 2020-01-06 19:29:51
问题 I have a graphical glitch related to blending in my OpenGL application using Android NDK. The strange thing is that when I take a screenshot through adb screencap command, the problem completely disappears and the result looks okay. My question is: Is there a way to know what is happening behind the scenes of making screenshots? Is there eglChooseConfig called with some specific values for the entire frame for example? Or maybe is there some specific initial GL state forced? Some background:

Uv-Coordinates: Theoretical questions

霸气de小男生 提交于 2020-01-06 17:59:48
问题 In my previouse question I had some problems regarding texturing in OpenGL ES 2.0. With some help this problem is solved now, but some related questions have appeared: How do I know wheather uv-coordinate and vertex-coordinates fit together? I thought there is a bijection between the vertex and uv, for example (0,0) of vertex to (0,0) of uv, and (width,0) of vertex to (1,0), and (0,height) of vertex to (0,1) of uv. But since the texture appears flipped in my example, the thought might be

Why can't I see certain OpenGL ES charts in the 4.2 Simulator?

白昼怎懂夜的黑 提交于 2020-01-06 16:15:10
问题 I am writing an application which contains some graphs drawn in OpenGL ES. each of these graphs are in a table cell, when I press some of those graphs, it is being opened in full screen mode. Everything worked perfectly since I upgraded to iOS4.2. Now the problem is in simulator, I can't see the drawn graph in cells, but in full screen mode I do see the chart. There are no changes no the device, it is only on the simulator and only in a case. The behavior is the same for other Mac's here.

Android OpenGL2.0 intersection between two textures

旧时模样 提交于 2020-01-06 15:54:51
问题 I'm making game in OpenGL2.0 and I want to check are two sprites have intersection but i don't need to check intersection between two rectangles.I have two sprites with texture,some part of texture is transparent,some not. I need to check intersection between sprites only on not trasnparent part. Example: http://i.stack.imgur.com/ywGN5.png 回答1: The easiest way to determine intersection between two sprites is by Bounding Box method. Object 1 Bounding Box: vec3 min1 = {Xmin, Ymin, Zmin} vec3

Android OpenGL2.0 intersection between two textures

微笑、不失礼 提交于 2020-01-06 15:54:30
问题 I'm making game in OpenGL2.0 and I want to check are two sprites have intersection but i don't need to check intersection between two rectangles.I have two sprites with texture,some part of texture is transparent,some not. I need to check intersection between sprites only on not trasnparent part. Example: http://i.stack.imgur.com/ywGN5.png 回答1: The easiest way to determine intersection between two sprites is by Bounding Box method. Object 1 Bounding Box: vec3 min1 = {Xmin, Ymin, Zmin} vec3