opengl-es

Android memory mapped file with vertices

I am trying to render vertices stored in a big file (approx 50Mb). The file layout is optimized so i can take a slice and give it to opengl to render a triangel strip directly. This works in the emulator, but when I run the same code in my magic (android 1.5) it crashes with a SIGBUS in libhgl.so. Sounds like a driver issue? I have tr...

Why does my android openGL ES test renderer crash

Hi Once again I'm trying to get into openGL, but as usual I choke when passing around vertices/vertixes/whatever and every little detail can lead to disaster (wrong format, initialization not properly set up, where memory are saved, etc.). My main goal is to use openGL for 2D graphics to speed up performance compared to regular cpu dra...

Changing shader-code in xcode on iphone opengl es 2.0 project results in an error.

Im new to shaders and I'm trying to learn the basics. But everytime I change some code in my vertex shader it results in an error. "Validation Failed: Program is not successfully linked." Im using the standard openGL project for the iphone as a starter in Xcode ( with a 2d cube moving in y-position). From the beginning th...

Is there a library that offers OpenGL fonts but via modern buffer methods?

As the title implies. I noticed FTGL, the main available, is via deprecated wasteful methods. ...

Radial gradient draw performance - Can OpenGL-ES improve?

I'm working on a image manipulation app that overlays a radial gradient over an image loaded from the photo library. On screen I have a slider to dynamically in/decrease the radius of the radial gradient. I've found the performance on the simulator to be just fine, but on an iPhone 3G or 3GS it is much slower to redraw when moving the s...

Is there an tutorial on loading an 3D model in openGL ES on the iPhone?

I've started to play around with some 3d modelers a while ago. Now I'm curious: How can I bring such an 3D model to the iPhone or iPad, so that I can see it on screen and maybe even rotate it with gestures? 1) What's the best file format for the 3D models? 2) How would I load a particular 3D model file into openGL ES and then render it...

OpenGL: Translate object to origin

I have a car model with different parts of the car described in vertex groups. I want to rotate the tires. The origin of the model is in the middle of the car. Want I'm thinking I need to do is translate the tires to the origin, rotate the tires, then translate them back to their original position. My problems if the translating to the ...

Issues with GLUtils.texImage2D and Alpha in Textures

Hi all I'm successfully generating my textures using GLUtils.texImage2D, but when I use the textures generated I get problems with my alpha: they are darker than wanted. after having checked several things I finally got the the conclusions that the problem comes from GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, bmp, 0); I created a s...

Loading a UIView from an OpenGL View.

Hi guys I'm new to iPhone programming, and in fact, programming of any kind. For nearly a year now I've been teaching myself C, and then Objective-C, and for the past few months I've been making an iPhone game, so far of which i'm pretty proud of. Anyways I've hit quite a stumbling block and I've been trying to figure it out for a whil...

How does the OpenGL Blend equation work?

opengl ver: opengl es 1.x platform: iphone The blending equation: (Rs Sr + Rd Dr, Gs Sg + Gd Dg, Bs Sb + Bd Db, As Sa + Ad Da) How does it work? I don't understand if I set both src and des to GL_ONE, and I have src color red (255,0,0) and des color black (0,0,0), the result will be (0,0,0) Can someone explain how the equation work,...

destroyFramebuffer method in an openGL app.

in my OpenGL type of iphone app, I have this method below in the GLView implementation. i noticed everytime i started up the app during development that the last frame that was present when i shut the app down the last time, would draw first before the app started its animation... but when i commented out this method, the app would...

Display a cube on a specific position in scene

Hello, I'm tracking the position of an quadrangle on a surface with my camera. This works fine. After getting these coordinates (4 edges) I want to display a cube on this position. (AR-like). How to calculate the model-transformations or (if it's better) to setup the camera-position ? Thanks in advance ... ...

Does textures drawn with glDrawTexfOES are affected by lights ?

Hi all, currently, I use glDrawArrays to render texture in simple quads. I hope increase framerate by using glDrawTexfOES instead (all my sprites have the same z position). Before doing this work I would like to know if these textures will still be affected by my 3d lights. ...

opengl es texture atlas for text

I need help on understanding the workflow for rendering text in opengl es using a texture atlas. This is for an iphone game. I've read this already: http://stackoverflow.com/questions/512258/is-there-a-decent-opengl-text-drawing-library-for-the-iphone-sdk What tools do I use to generate the texture atlas image? Do I need freetype for ...

Is OpenGL threadsafe for multiple threads with distinct contexts?

I know that sharing a single context between threads is bad news. I know that I can safely create and use a context with an offscreen framebuffer on a secondary thread when nothing is happening with GL on the main thread. I haven't yet been able to find a definitive answer to the question of whether I can safely create two contexts on t...

cocos2d-iphone setBlendFunc()

Here is what my code look like CCSprite *sp = [CCSprite spriteWithFile:@"textureWithOneColorbackground.jpg"]; [self addChild:sp]; // Change the blending factors [sp setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE}]; [sp setColor:ccBLACK]; The original texture color is (246,149,32) The outcome now is (0, 0, 0) According to OpenGL, the cal...

OpenGL ES For Iphone

I have no experience at all with OpenGL and just started playing around with iPhone development. From google, it seems that iphone uses a special type of opengl (openGL ES). What are the languages that is supported by openGL ES? I know a little bit of C++ but by now i believe my C and Objective-C is better than C++. ...

OpenGL sprites are trembling slightly at rendering

Hi all, I made a class which manage sprites in an iphone application by using opengl es. rendering works well but when the sprite sheet is large (more than 512x512px) and the sprite has a part which doesn't move, this part seems trembling slightly (like if antialiasing was computed differently for each frame). Is it normal or is it a bu...

How do I fill in the holes in this NyARToolkit iPhone example?

I'm trying to compile a project with the NyARToolkit library following the instructions here. It provides almost all the source code that you need, but not the EAGLView class that he is using. It gives a link that is redirected to a newer version of the GLSprite sample code, which no longer works with this example. How do I fill in t...

How to detect the area of touch in open gl es in android ?

Hi.. I have designed a 3D model in .obj format and imported using min3d framework. Its a cube with different colors. I want to give a Toast with a message for a particular color when the side of that particular color is touched. How do I do this in android 1.6 ? ...