opengl-es

Using GLKView with a UIViewController

為{幸葍}努か 提交于 2020-01-13 05:53:32
问题 I wanted to use OpenGL to do some simple Image processing, so I started off with GLKView . Since I don't need to refresh the view every few seconds, I didn't use the GLKViewController and instead used a normal UIViewController subclass. My question is that do I simply make the viewController's view as a GLKView or do I add the GLKView as a subview of the view controller's view. Since I'm adding a UISlider to the view as well, I think the latter seems better, but I'm not sure. I also need to

iOS GLKit and back to default framebuffer

喜夏-厌秋 提交于 2020-01-13 05:38:10
问题 I am running the boiler plate OpenGL example code that XCode creates for an OpenGL project for iOS. This sets up a simple ViewController and uses GLKit to handle the rest of the work. All the update/draw functionality of the application is in C++. It is cross platform. There is a lot of framebuffer creation going on. The draw phase renders to a few frame buffers and then tries to set it back to the default framebuffer. glBindFramebuffer(GL_FRAMEBUFFER, 0); This generates an GL_INVALID_ENUM.

How can I draw (as in GLPaint) onto a background image, and with temporary drawings?

纵饮孤独 提交于 2020-01-13 03:20:30
问题 I am writing a GLPaint-esque drawing application for the iPad, however I have hit a stumbling block. Specifically, I am trying to implement two things at the moment: 1) A background image that can be drawn onto. 2) The ability to draw temporary shapes, e.g. you might draw a line, but the final shape would only be committed once the finger has lifted. For the background image, I understand the idea is to draw the image into a VBO and draw it right before every line drawing. This is fine, but

How to get around the performance issues with Buffer.put() and Android OpenGL

心不动则不痛 提交于 2020-01-12 10:39:27
问题 It is a Java issue in general, though in this particular case I am using Vertex Arrays in Android for OpenGL. To use this basic GL system, you must use Java's Buffer system in native allocation mode. This is very slow on Java. And roughly 40-50% of my entire application's time is spent inside of buffer.put(). Is there any way to speed this up while staying in Java (ie, don't use the native sdk)? 回答1: Avoid allocations in general. Use a pool of buffers and juggle them around as needed. You can

Drawing into OpenGL ES framebuffer and getting UIImage from it on iPhone

老子叫甜甜 提交于 2020-01-12 03:53:11
问题 I'm trying to do offscreen rendering of some primitives in OpenGL ES on iOS. The code is as follows: // context and neccesary buffers @interface RendererGL { EAGLContext* myContext; GLuint framebuffer; GLuint colorRenderbuffer; GLuint depthRenderbuffer; } .m file: - (id) init { self = [super init]; if (self) { // initializing context myContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; [EAGLContext setCurrentContext:myContext]; [self setupOpenGL]; // creating buffers }

Arcball Rotation with Quaternions (using iOS GLKit)

一笑奈何 提交于 2020-01-11 19:57:06
问题 I'm looking for a simple implementation for arcball rotation on 3D models with quaternions, specifically using GLKit on iOS . So far, I have examined the following sources: Arcball rotation with GLKit How to rotate a 3D object with touches using OpenGL I've also been trying to understand source code and maths from here and here. I can rotate my object but it keeps jumping around at certain angles, so I fear gimbal lock is at play. I'm using gesture recognizers to control the rotations (pan

iOS: playing a frame-by-frame greyscale animation in a custom colour

让人想犯罪 __ 提交于 2020-01-11 07:16:26
问题 I have a 32 frame greyscale animation of a diamond exploding into pieces (ie 32 PNG images @ 1024x1024) my game consists of 12 separate colours, so I need to perform the animation in any desired colour this I believe rules out any Apple frameworks, also it rules out a lot of public code for animating frame by frame in iOS. what are my potential solution paths? these are the best SO links I have found: Faster iPhone PNG Animations frame by frame animation Is it possible using video as texture

SSAO artefacts in Three

百般思念 提交于 2020-01-11 07:10:51
问题 I'm really struggling to fix an issue with my SSAO shader and could desperately use some help. Basically the shader seems to work on some objects, but looks really bad on others. From the below you can see the sphere looks correct, but the cube seems to be doing occlusion on normals that it shouldn't. Here is a screenshot: I am basing my shaders off of this tutorial: http://devmaster.net/posts/3095/shader-effects-screen-space-ambient-occlusion In my render chain I render 2 render targets

SSAO artefacts in Three

99封情书 提交于 2020-01-11 07:10:43
问题 I'm really struggling to fix an issue with my SSAO shader and could desperately use some help. Basically the shader seems to work on some objects, but looks really bad on others. From the below you can see the sphere looks correct, but the cube seems to be doing occlusion on normals that it shouldn't. Here is a screenshot: I am basing my shaders off of this tutorial: http://devmaster.net/posts/3095/shader-effects-screen-space-ambient-occlusion In my render chain I render 2 render targets

Rendering multiple 2D images in OpenGL-ES 2.0

末鹿安然 提交于 2020-01-11 06:49:07
问题 I am new to OpenGL, and trying to learn ES 2.0. To start with, I am working on a card game, where I need to render multiple card images. I followed this http://www.learnopengles.com/android-lesson-four-introducing-basic-texturing/ I have created a few classes to handle the data and actions. MySprite holds the texture information, including the location and scale factors. Batcher draws all the sprites in one go. It is rough implementation. ShaderHelper manages creation of shaders and linking