opengl-es

How do I shut down OpenGL tasks in applicationWillResignActive?

爷,独闯天下 提交于 2020-01-02 09:32:52
问题 I have nearly completed my first app. In testing on the device, I am getting a crash when I press the home button, with the error message libGPUSupportMercury.dylib`gpus_ReturnNotPermittedKillClient: Based on these posts: https://stackoverflow.com/search?q=how+to+shut+down+OpenGL OpenGL ES crash on move background, iOS 5.1 I am pretty sure the problem is that my app is an extension of software that uses some sample code involving OpenGL (about which I have very little understanding) and that

How do I shut down OpenGL tasks in applicationWillResignActive?

拟墨画扇 提交于 2020-01-02 09:30:04
问题 I have nearly completed my first app. In testing on the device, I am getting a crash when I press the home button, with the error message libGPUSupportMercury.dylib`gpus_ReturnNotPermittedKillClient: Based on these posts: https://stackoverflow.com/search?q=how+to+shut+down+OpenGL OpenGL ES crash on move background, iOS 5.1 I am pretty sure the problem is that my app is an extension of software that uses some sample code involving OpenGL (about which I have very little understanding) and that

Creating and loading .pngs in RGBA4444 RGBA5551 for openGL

蹲街弑〆低调 提交于 2020-01-02 09:11:00
问题 I'm creating an openGL game and so far I have been using .pngs in the RGBA8888 format as texture sheets, but those are too memory hungry, and my app crashes frequently. I read in Apple's site that such format such be used just when too much quality is needed, and recommends to use RGBA4444 and RGBA5551 instead ( I already converted my textures to PVR but the quality loss is too great in most of the sprite sheets). I only need to use GL_UNSIGNED_SHORT_5_5_5_1 or GL_UNSIGNED_SHORT_4_4_4_4 in my

Vector math, finding coördinates on a planar between 2 vectors

安稳与你 提交于 2020-01-02 07:06:54
问题 I am trying to generate a 3d tube along a spline. I have the coördinates of the spline (x1,y1,z1 - x2,y2,z2 - etc) which you can see in the illustration in yellow. At those points I need to generate circles, whose vertices are to be connected at a later stadium. The circles need to be perpendicular to the 'corners' of two line segments of the spline to form a correct tube. Note that the segments are kept low for illustration purpose. [apparently I'm not allowed to post images so please view

SceneKit - Map cube texture to box

旧城冷巷雨未停 提交于 2020-01-02 05:46:04
问题 I've a texture for a cube that looks like I'd like to use it on a cube in a SceneKit view. I'm using the SceneKit geometry SCNBox for that. Unfortunately, the result is that the texture is projected entirely on each face, instead of using only the corresponding part: let videoGeometry = SCNBox(width: 1, height: 1, length: 1, chamferRadius: 0) videoGeometry.firstMaterial?.isDoubleSided = true videoGeometry.firstMaterial?.diffuse.contents = UIImage(named: "test")! I know I can use shader

how to do Object detection in opengl Android?

别等时光非礼了梦想. 提交于 2020-01-02 05:36:31
问题 I've started with OpenGl es for Android since 2 weeks and after trying 3D examples I'm stuckup at obect detection. Basically mapping between x,y coordinates of screen to x,y,z of 3d space and vice a versa. I came across : GLU.gluProject(objX, objY, objZ, model, modelOffset, project, projectOffset, view, viewOffset, win, winOffset); GLU.gluUnProject(winX, winY, winZ, model, modelOffset, project, projectOffset, view, viewOffset, obj, objOffset); but i failed to understand that How do I use them

MonoTouch OpenTK and UniformMatrix4

∥☆過路亽.° 提交于 2020-01-02 04:20:08
问题 I'm trying to pass an OpenTK Matrix4 to a shader uniform, but there doesn't seem to be a suitable overload for GL.UniformMatrix4. The overloads accept either float or float[] or ref float . Similarly I can't find a way to convert a Matrix4 instance to a float array - I've seen one sample that uses a ToArray method on the Matrix4, but that doesn't seem to be present in the distribution I'm using. Sure I'm missing something simple as this is pretty fundamental to being able to pass a model/view

Uniform vertex displacement for skinned mesh shader (Animated outline, Three.js)

孤街浪徒 提交于 2020-01-02 04:07:28
问题 I think I've solved implementation of rendering borders/outlines over meshes in Three.js, a technique many games use for highlighting objects/characters. Diablo 1 and 3 for example Here are details and demo of my solution. Now what remains to be done are animated meshes (for characters etc). The problem is, skinned mesh is animated with a vertex shader and I also used a shader to scale (displace) the mesh out along the normals. It might be pretty straight-forward but unfortunately my math

How to measure VRAM consumption on Android?

帅比萌擦擦* 提交于 2020-01-02 00:56:11
问题 I want to acquire Android Device VRAM size. Is there a method for acquisition from the program? 回答1: Let's do some calculation using Nexus One: Screen resolution is 480x800. So minimum required video memory size would be: 400 * 800 * 4 bytes = 1536000 bytes Assuming that driver may (and normally should) use several buffers, we should also expect values like: 1536000 * 2 bytes = 3072000 bytes 1536000 * 3 bytes = 4608000 bytes etc... It would be weird to have values that are not multiple of

Hide faces with GLSL shader

五迷三道 提交于 2020-01-01 22:29:12
问题 I'm trying to wright a shader to work with three.js. Which is a javascript library for WebGL. I just started reading up on GLSL so there are some thing i'm having trouble with. Basically I want reveal and hide faces of a geometry. I have cloned my geometry's face array and reordered it. The reordered array has the faces in the order I would like to reveal/hide them. I have read that Uniforms can be access from anywhere within the pipeline. Can I just declare the array as a Uniform and access