Tag Info

New answers tagged

1

You actually are getting a performance increase, which is most significant around the N = 3000 mark (in the alpha blending off case). The solid 60fps for lower counts is, of course, being caused by vsync which means that your figures actually aren't valid. You'd probably do better with something like: glFinish (); startTime = GetTime (); // substitute ...


4

Here's some guesses for you to experiment with: Batch count is mainly a CPU load optimization, and not a GPU one. Try measuring CPU performance instead, for example by adjusting the positions so everything get clipped off screen. I wouldn't be surprised if the driver realizes that each batch is actually pointing into a contiguous array and merges them all ...


0

GLES rendering has a CPU cost and a GPU cost. Rendering less often should reduce both of these. I don't believe the CPU meter can show you the GPU cost, and I'm not sure why it would indicate that your CPU usage is greater. Maybe the (presumably trivial) activity of the third thread is being exaggerated in the accounting? You can get a simple per-thread ...


1

Set contentScale before allocating render buffer memory, i.e: inside GLView, not AppDelegate. I deleted the following code from AppDelegate and placed it into GLView: if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { NSLog(@"iPad detected"); } else { if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] ...


1

The warning you see is because you didn't add a view controller to your window. If your AppDelegate does the work of loading up the view, a view controller isn't necessary, however Apple recommends using them. It's not a critical warning. I believe you need to set the content scale on both the backing EAGL layer and the view itself. UIView has the layer ...


0

The simple answer is YES. You re-render those dynamic vertices once per 'frame' and it is easy. Making a modeling program will be far from easy however. You don't have the right notion about shaders and vertices. I think you've misunderstood the examples that you've seen. A shader is the program that draws the fragments that make up the screen. That ...


0

glGetError is slow on Android and should be avoided. Something you can do is create a LoggerInterface, which is called for each method call. Put a dummy implementation that does nothing in you release code, and a real one in your lab (which calls glGetError). In release code, check glGetError once per frame, and activate the real LoggerInterface for the next ...


0

After close inspection I found that the line: gl_FragColor = baseColor * ( lightColor + 0.25 ); is probably exactly equal to: gl_FragColor = baseColor * ( baseColor + 0.25 ); when uniform sampler2D s_lightMap isn't being loaded into the program. EDIT: This may or may not be because of the State Functionality of openGL es 2.0, but I wouldn't bet on ...


1

One option is having a vertex buffer describing the positions of the object's vertices, and then using something like glBufferSubData to update those positions to move them around. That could be generalized to having a way to update any particular attributes being sent to the vertex shader (color, opacity, transformation data, etc.). So you'd create a ...


0

This code works: // Get the current modelview matrix GLKMatrix4 originalMat = self.effect.transform.modelviewMatrix; GLKMatrix4 currMat = self.effect.transform.modelviewMatrix; // Print the original matrix for comparison //NSLog(@"Original Matrix:"); //[self printMatrix:currMat]; // Define the buffer designators GLuint billboardVertexArray; GLuint ...


2

xoffset = (targetScreenWidth - image1Width)/2;


0

How does one typically specify 3D objects in games ? Is .obj a good alternative ? .obj is one of the easiest 3D formats to parse if you're doing it yourself. You can also export it from just about any modeling software. (I recommend Blender, but whatever you do, definitely don't do it yourself in code). However, it sounds like you might be just ...


1

I assume you're talking about running the code on the end user's machine, not just for testing. You definitely should not call glGetError after every GL function call. You cannot know how it is implemented in certain drivers or how it will be implemented in the future. As a practical example, on NaCL (and possibly anywhere using Google's WebGL ...


0

I'm not really sure what exactly you hope to achieve, the proposition sounds sketchy. In any case, I'm pretty sure you get your error for trying to calculate the dot product between a vec4 and a vec3. The mathematical dot product is only defined for vectors with the same number of dimensions, most programming languages mirror this.


2

As you already have a delta time in seconds, and also the 'speed' of the texture in whatever units you use per second, then you simply need to move the texture by the speed (0.001) multiplied by the delta in seconds. Say if you have a delta of 0.5 seconds, the movement would be 0.0005, which is what you want. To implement it in your program, change ...


1

vTime is a float, but you're passing it as an int, since you're using glUniform1i(). Adding integer values to your texcoords has no effect. Use glUniform1f() instead.


2

The less times you have to send texture data through the pipeline for rendering the better. A single larger texture set would be more efficient than 1,000 smaller ones of the same memory capacity. It is not uncommon for developers on limited platforms, or developers trying to push the limits of consoles (even today) to pack textures and limit the amount of ...


1

Is this structure the right way of doing things? Nothing wrong with that setup. I'd just be careful about the Splash screen. Splash screens (for Android) are meant as a temporarily placeholder to show that something is loading. If your App takes less then a second to load, then you shouldn't have a splash screen. Too many people make splash screens ...



Top 50 recent answers are included