opengl-es

texture not drawing in single EAGLview

I am taking picture from camera with zooming it and then assign UImage to EAGLview. Add EAGLview as subview on UIImageview. first it shows the image properly but when again i take picture and load it, it shows only green color on screen. Sometimes get errors: AVCapture: no preview image available; creating one manually instead Couldn'...

Fullscreen texture iPhone OpenGL ES

I'm aware that OpenGL textures on the the iphone are required to be a power of 2, is this true of OpenGL 2.0 as well? If I have an image that is 320 x 480 in size and want to draw it full screen is there any possible way to do this with OpenGL. Thanks ...

should i learn Quartz for iphone game programming?

Hi all..I wanna learn and develop 2d game on iphone but i don't know if i should learn Quartz 2d first, or i can just jump into openGL ES directly? ...

Why does this code sometimes return NaN?

This often returns NAN ("Not A Number") depending on input: #define PI 3.1415f GLfloat sineEaseIn(GLfloat ratio) { return 1.0f-cosf(ratio * (PI / 2.0f)); } I tried making PI a few digits smaller to see if that would help. No dice. Then I thought it might be a datatype mismatch, but float and glfloat seem to be equivalent: gl.h t...

Drawing only part of a texture OpenGL ES iPhone

..Continued on from my previous question I have a 320*480 RGB565 framebuffer which I wish to draw using OpenGL ES 1.0 on the iPhone. - (void)setupView { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, (int[4]){0, 0, 480, 320}); glEnable(GL_TEX...

IllegalArgumentException when trying to run an OpenGL ES 2.0 application

When I add the following line to my GLSurfaceView class I get an IllegalArgumentException from some random place. I don't know where the problem is because it doesn't give a stack trace. setEGLContextClientVersion(2); What else do I need to do to get an OpenGL ES 2.0 application to work? NB: I'm trying to run the application on the e...

Does OpenGL (ES) draw objects completely outside of the viewport?

I have a viewport setup with orthographic projection. If I ask OpenGL to draw a quad outside of the viewport (x y bounds) using glDrawArrays(), does it ignore, or still draws it? ...

GLPaint sample set background image

Hi all! I'm looking the GLSample provided by apple and I have a question... how can I change the background (now is black)?? best was to use an image!! thanks ...

calculate camera up vector after glulookat()?

I'm just starting out teaching myself openGL and now adding openAL to the mix. I have some planets scattered around in 3D space and when I touch the screen, I'm assigning a sound to a random planet and then slowly and smoothly flying the "camera" over to look at it and listen to it. The animation/tweening part is working perfectly, b...

How to control an OpenGL projection matrix with iPhone accelerometer/compass values?

Is there any ready made class/formula somewhere I can use it for control my viewpoint by accelerometer's/compass's XYZ? I want to achieve the same view control like acrossair uses. I have the parts (OpenGL space, filtered accel-, compass values, and a cubic panoramic view mapped to a cube around my origin). Can somebody suggest me whe...

Texture memory on iPad/iPhone 4

Does anybody know how much texture memory will be available for OpenGL on the new iPhone 4? How much is on the iPad? Thanks! ...

iPhone cocos2d CCTMXTiledMap tile transitions

I am using cocos2d on the iPhone and am wondering if it is possible to use a texture mask in order to create tile transitions / fringe layer. For example, a grass tile and a dirt tile, I would want a tile that had both grass and dirt in it... Has anyone done this, or is the only way to create one tile for every possible transition? ...

OpenGL ES canvas size

Ahoy, I'm working on an OpenGL ES based game for Android using the NDK. My application is targeted towards SDK 1.6 and above. I seem to be having a problem creating a canvas of the phones native size. My rendering is done through a native gameloop that uses OpenGL 1.0. I'm using the emulator and that gives me a 480x320 canvas -- this i...

Problem when trying to use simple Shaders + VBOs

Hello I'm trying to convert the following functions to a VBO based function for learning purposes, it displays a static texture on screen. I'm using OpenGL ES 2.0 with shaders on the iPhone (should be almost the same than regular OpenGL in this case), this is what I got working: //Works! - (void) drawAtPoint:(CGPoint)point depth:(CGFloa...

glFramebufferTexture2D performance

I'm doing heavy computation using the GPU, which involves a lot of render-to-texture operations. It's an iterative computation, so there's a lot of rendering to a texture, then rendering that texture to another texture, then rendering the second texture back to the first texture and so on, passing the texture through a shader each time. ...

How to get X,Y,Z rotations of vertices on a sphere at the origin?

Hey, I have a sphere in my game world and i would like to place a plane at each vertex on this sphere for debugging purposes. The planes should be orientated so that they lie flat against the sphere (perpendicular to the normals). The sphere is located at the origin, so all the vertices are relative to that. If my thinking is correct, i...

How to use point sprite API in Android NDK

I want use point sprite (OpenGLES Extension) API in Android NDK(r4). right here int att[] = {0,0,1}; glPointParameterxv( GL_POINT_DISTANCE_ATTENUATION, att ); But, doesn't work it. ...

Drawing bitmaps faster on Android canvas or OpenGL

I currently have a game written using the Android canvas. It is completely 2D, and I draw bitmaps as sprites on the canvas, and it technically works, but I have a few features that I need to add that will require drawing many more bitmaps on the screen, and there will be a lot more movement. The app needs more power. What is the best ...

Drawing individual pixels with iphone sdk.

Hi, I've been trying to figure out how to make a powder toy style game on the iPhone. My problem is how to draw pixels to the screen. From what I've read, OpenGL is better for games as it is faster/hardware accelerated, but there is no method to draw pixels directly to the screen. Apparently drawing pixels to an off-screen frame buffer ...

Open GL ES 2.0 co-ordinate systems

Hi, I want to use Open GL ES 2.0 for a new game, but I have two questions. Q: The first is how do I set up perspective views in Open GL ES 2.0 - do I need to include Open GL ES 1.0 and use glOrtho, or is there a new way? Q: I want to use the 4th quadrant of a Cartesian co-ordinate system for my game and not use -0.5 to +0.5 for values ...