This code:
public void onSurfaceChanged(GL10 gl, int w, int h) {
gl.glViewport(0, 0, w, h);//
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glLoadIdentity();
gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadIdentity();
// set camera zoom
GLU.gluPerspective(gl, 45.0f,(float) w / h, 0.1f, 100.0f);
// point camera
GLU.gluLookAt(gl, 0, 1, 5, 0f...
if you are calculating the normals of a polygon for rendering it on WebGL, do you use a normal for every index in the index array or for every vertex on the vertex array?
...
Hello all, reading #20 tutorial on Nehe and a question here about masking, I implemented masking using b/w image and opaque image, however the result is completely not what is expected (I'm using OpenGL ES 1 on iPhone, so can't use shaders).
Source+Mask=Result
As can be seen on the result picture what is white on mask isn't transparent ...
I have a fragment shader with the following:
const lowp float colors[8] = float[8]( // line 12
0,0,0,1,
1,0,0,1
);
but it fails to compile:
ERROR: 0:12: 'array of float' : array type not supported here in glsl < 120
ERROR: 0:12: 'array of float' : constructor not supported for type
ERROR: 0:15: 'array of float' : no matchin...
This NVIDIA video podcast (dated?) suggests bypassing OpenGL's matrix stack as a performance tip. It also suggets to bypass OpenGL's lighting, which implies that their intention is to actually transform the geometry manually. I happen to do this anyway for other reasons.
Ofcourse, it doesn't make sense that you'll actually benefit from ...
I'm trying to push my FPS up on iPhone 3Gs from 30 as high as possible... and I'm running into a couple of issues and thought it would be better to ask for advice.
1) What exactly do the Renderer Utilization and Tiler Utilization columns on the OpenGL ES Instrument signify? My Tiler Utiliation percentage is extremely low, and my Rendere...
I am a starter of Iphone opengl ES programming. I have two textures, the first one is the background and occupies the full screen. I am printing the second picture on top of the first image but the white background of the second image covers part of the background. I want the background to be visible where the foreground picture has no c...
Hello everyone,
Here's my problem. I'm drawing a box using a GL_TRIANGLE_STRIP. There is no texture involved, no material and no shaders. I'm just rendering colored triangle.
You can see what it looks like here : Fail box
But as you can see, I've some clear color fading problem. There is no lighting activated either.
Here the code I...
Hi,
I have just began opengl programming in android and i am fairly new to opengl as well. I've been using nehe's opengl tutorials as well as insanitydesign's android ports. I successfully managed to create a cube with a single texture mapped to all its 6 faces. I even mapped multiple textures to different faces of the cube.
...
I am new to Android Development. What I want is to know how I have to begin thinking to program a neat, sexy GUI. I guess the android.opengl API is a good starting point.
Let's say we wanna create something like a simplified 3D-Pool-Billard-Game: You see the table from the top and you have on the table the balls. You want to make them r...
In OpenGL ES 1.1 (using Objective-C), what is the easiest way to create a circle, and for a sphere? I would prefer for it to be easy to implement, as I am new to OpenGL.
Thanks
jrtc27
...
Sorry for the duplicaiton, but I've been googlin' for hours now without any result.
I have this (optimized) data of a simple cube exported from a converter:
// 8 Verticies
// 4 Texture Coordinates
// 6 Normals
// 12 Triangles
static GLshort cubeFace_indicies[12][9] = {
// Box001
{2,0,3 ,0,0,0 ,0,1,2 }, {1,3,0 ,0,0,0 ,3,2,1 }, ...
I have tried as follows (got through Google search)-
static const GLfloat vertices[] =
{
0.0, 0.0,
250.0, 280.0,
250.0, 280.0,
250.0, 500.0,
250.0, 500.0,
350.0, 500.0,
350.0, 500.0,
250.0, 280.0
};
static const GLubyte squareColors[] = {
255, 255, 255, 255,
255, 255, 255, 255
};
glD...
Hi all , Can Anybody explain me what is EGL And How it does ?!
How can i use EGL with OpenGL-ES On Linux?!
IS EGL a Layer Between Hardware And Operating System ?!
...
I just opened an iPad app I'd been working on and it was working fine, until now. I open it and the screen remains black, even after it's loaded! It's an OpenGL and I just downloaded the iOS4 SDK. I also added a provisioning profile. Would any of these changes result in a completely black screen with no error for no reason at all?
It lo...
With the stencil buffer in opengl-es for Android, I'm simply trying to mask out drawing part of the screen. I think I have it set up right, but it is not masking out the non-stenciled parts. Below is an extraction of code for what I'm doing.
gl.glEnable(GL10.GL_STENCIL_TEST);
gl.glClearStencil(0);
gl.glClear(GL10.GL_STENCIL_BUFFER_BIT);...
I'd like to hear what people think the optimal draw calls are for Open GL ES (on the iphone).
Specifically I've read in many places that it is best to minimise the number of calls to glDrawArrays/glDrawElements - I think Apple say 10 should be the max in their recent WWDC presentation. As I understand it to do this you need to put all ...
Hello,
I have the fallowing situation using vertex buffers in OpenGL on iPad:
- render some objects with 30 FPS
- delete the objects and create new ones(kill all entities and spawn others)
- render the new objects
The FPS drops to 10 for few seconds and slowly recovers to 30. I used some timers and I saw that render time increases from...
So, I'm writing a game engine.
I have a little example (see http://qrcode.kaywa.com/img.php?s=8&d=http://rokonandroid.com/rd.apk), that seems to work fine on every device except Droid / Milestone.
It displays a blue screen (due to glClearColor being set to blue), and nothing more.
I have tried with/without textures, and with/witho...
Hello, i have a 3D project based on the EAGLView exemple from Apple.
I have a very stange bug with the context ( i think ), my context is create by using :
[context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer];
on init the 3D view it's work, and on layout subview, my frameBuffer is destroy an crea...