OpenGL ES 2.0 emphasizes a programmable 3D graphics pipeline (comparing to fixed-function pipeline of OpenGL ES 1.1).

learn more… | top users | synonyms

1
vote
2answers
384 views

How to flip a quad (openGL es 2.0 Android / Java)

bHow would one go about 'flipping' a quad i.e., either horizontally or vertically? (Just a single quad, not everything in view). I know how to rotate a quad, this is my rotation method: public void ...
0
votes
1answer
299 views

ParallaxBackground AndEngine

I'm new to game development andengine. I want to add ParallaxBackground but I don't know how to change background on player move. I'm using arrow for moving a player. Now my question is where I write ...
7
votes
2answers
4k views

GLSL Shader - Change Hue/Saturation/Brightness

I'm trying to change the hue of an image using a GLSL fragment shader. I want to achieve something similar to Photoshop's Hue/Saturation Adjustment layer. In the following image you can see what I've ...
1
vote
1answer
407 views

GLES2-AnchorCenter branch has no org.andengine.util.color.Color

I am porting my game from GLES2 to GLES2-AnchorCenter branch. I am using import org.andengine.util.HorizontalAlign; import org.andengine.util.color.Color; import ...
6
votes
1answer
166 views

How to prevent clipping when moving through a tunnel?

I'm developing for Android using OpenGL ES 2.0. It's going to be a game where you have to fly through a tunnel without hitting the walls. However, the tunnel wall gets clipped as the player ...
2
votes
1answer
159 views

re-using objects

I'm working with openGL ES 2.0 on Android and I've created a custom 'Quad' class. This allows me to make a sprite object like so: Quad mySprite = new Quad(); mySprite.setSize(w,h); ...
1
vote
1answer
203 views

How to deal with lot of textures in one draw call?

I'am currently developing text rendering & some kind of tile based texturing for simple landscape with textures blending. e.g. something like this but in 3D. In first realization I have been used ...
2
votes
1answer
219 views

Keeping everything within one Activity

Overview My game is currently based on a single activity (rather than multiple activities) and I would like to keep it that way. At the moment, it goes straight into the game at level 1. I will ...
0
votes
0answers
105 views

GLRenderer will not run when resuming app

I'm displaying a dialogue over my GLRenderer and then dismissing it from my Renderer's onSurfaceChanged method (once all resources have loaded and just before rendering starts) When I first run my ...
1
vote
0answers
373 views

How to implement OpenGL triple buffering

I'm trying to implement the triple buffering described here ...
0
votes
1answer
105 views

OpenGL ES - write code in Windows

Is it possible to write application using OpenGL ES 2.0 "emulator" from AMD (AMD OpenGL ES SDK) and then use the same code (compile again, of course) in my iOS / Android / Whatever application ? The ...
0
votes
2answers
433 views

Scale Matrix Transform without moving primitive

So I have the following.... GLbyte vShaderStr[] = "attribute vec4 vPosition; \n" "uniform mat4 move; \n" "uniform mat4 scale; \n" "void main() \n" "{ ...
1
vote
2answers
1k views

Simple Android loading screen when using OpenGL

My game uses openGL ES 2.0 on Android and it's got to the point where the pause (while loading resources) has become noticeable. All I'm after is to show a static screen (probably via an XML layout ...
1
vote
2answers
123 views

NPOT texture and video memory usage

I read in this QA that NPOT will take memory as much as next POT sized texture. It means it doesn't give any benefit than POT texture with proper management. (maybe even worse because NPOT should be ...
2
votes
1answer
264 views

Full-screen post-processing and texture size

I am newbie writing a post-processing code for mobile devices, and asking some trivial, conventional solution for a specific problem. AFAIK, post-processing in OpenGL is trivially done with FBO bound ...
0
votes
3answers
169 views

Rotating each quad in a batch separately?

Background In my app I use the following code to rotate my quad: Code //Rotate the quad Matrix.setIdentityM(mRotationMatrix, 0); Matrix.translateM(mRotationMatrix, 0, centreX, centreY, 0f); ...
1
vote
2answers
719 views

“Non-additive” alpha blending in OpenGL ES 2.0, Android (AndEngine)

I have several monochromatic sprites and I render them with alpha = 0.25 (all of them the same value). I want to "paint" with them, so when they overlap, the alpha won't be added. I am not sure if I ...
1
vote
2answers
663 views

Libgdx: Am I abusing Vector2? Is there a better way to do my position updates and rendering?

I'm simulating hair in a game. Currently I have a HairField object, which has a position defined by a Vector2. Each HairField has multiple Hair objects in a list, each with a position defined by a ...
0
votes
1answer
70 views

OpenGL ES 2.0: Texture does not appear to be correct [closed]

Here are my shaders... GLbyte vShaderStr[] = "attribute vec4 vPosition; \n" "attribute vec2 texPosition; \n" "attribute vec4 inColor; \n" "varying vec4 fragColor; \n" "varying vec2 ...
2
votes
1answer
338 views

Combining 2D and 3D in game engine

I've implemented basic 3D functionality and made little "2.5D" demo in orthographic projection using OpenGL ES 2 and Box2D. Now I want to make completely two-dimensional game (using sprites) and ...
0
votes
1answer
94 views

OpenGL ES2: Changing Z doesn't appear to change the location of triangle

So I am very new to OpenGL out I am playing around and trying to create a rectangle. GLfloat vVertices[] = { -0.5f, -0.5f, 0.0f, -0.5f, 0.5f, 0.0f, 0.5f, -0.5f, 0.0f,0.5f,0.5f,0.0f}; ...
8
votes
1answer
525 views

GL ES: Fragment shader optimization

Summary: I get FPS slowdown as soon as I try to tint the sprites (i.e: multiply texture with color in the fragment shader) Details: Hardware: iPod touch 4 I am drawing 700 sprites on the screen ...
3
votes
2answers
1k views

OpenGL ES 2.0: 2D game rendering, no performance gain with glDraw call batching

I just did a small benchmark. To my surprise batching sprites into a single draw call doesn't give any significant performance boost. Following are my results: Hardware: iPod touch 4 Extra info: ...
7
votes
1answer
992 views

Optimizing performance of a heavy fragment shader

I need help optimizing the following set of shaders: Vertex: precision mediump float; uniform vec2 rubyTextureSize; attribute vec4 vPosition; attribute vec2 a_TexCoordinate; varying vec2 tc; ...
3
votes
2answers
526 views

OpenGL ES 2.0: Enabling hi-res on iOS

I created an empty iOS project and then added a custom GLView class which is then added to AppDelegate. I have following questions: 1) How do I enable hi-res retina mode on iPhone 4? Currently I am ...
6
votes
1answer
656 views

Android game loop's effect on cpu/battery usage - unexpected results

I will try to keep this question as concise and as readable as I can. I recently came across an odd problem with my Android game that I'm developing. It's an openGL ES 2.0 game and initially I was ...
0
votes
0answers
207 views

How to render alpha channeled animated 2D sprites in OpenGL ES 2.0

I searched, but I can't find specifically how to render animated 2D sprites with an alpha channel onto a 3D polygon, z=0, in OpenGL ES 2.0. This is just a basic 2D concept, but since I'm using, ...
1
vote
1answer
74 views

I have a frag shader, one with an empty s_lightMap, how and why is it effecting the output?

I have an image of concrete rocks of different shades of colors, and I'm applying this shader, but without referencing s_lightMap's uniform in my program: precision mediump float; ...
1
vote
1answer
283 views

Centering GLViewport position within physical screen

I'm developing my app on one device and want it to display at the same ratio on all other devices. Currently what I have is 'image 1' in my image below - the game fits perfectly onto my development ...
-1
votes
1answer
95 views

Specifying 3D objects in a game [closed]

I have hands on experience in OpenGLES 2.0 , OpenGL and wish to apply the same in a 3D game development in Android. My idea is to develop a Combat game having fighter planes. I am trying to create a ...
1
vote
2answers
374 views

Calling glGetError() in release builds?

Currently, I'm calling glGetError() after each OpenGL function call in order to be able to detect and report bugs. I've been reading that glGetError() calls should be reduced to once per frame in ...
0
votes
1answer
546 views

iOS OpenGL ES 2.0 How to Billboard on Sphere and Rotate with Sphere

I have a sphere (earth) in OpenGL ES 2.0 for iOS. I also have markers that I want to place at lat/lons on the earth - but I want the markers to always face the user ( billboards ) but also move with ...
0
votes
1answer
201 views

bump mapping with 2 normal maps

I was wondering if its actually possible to do bump mapping with 2 normal maps... I have tried doing it this way however I get a function overload on max and dot. uniform sampler2D n_mapTex; uniform ...
0
votes
1answer
123 views

texture movement stutters

Hey I at the moment I have got my texture to move however it stutters as I increment by 0.001 every second. My animation is done via FPS if that make sense and here is some code FrameCount++; ...
0
votes
1answer
219 views

texture won't move OpenGL ES 2.0

I want be able to move my texture in GLSL I have set my texture to wrap S and wrap T but not sure why it wont move my fragment shader looks like this at the moment uniform sampler2D n_mapTex; ...
1
vote
1answer
444 views

How would one render dynamic vertices in OpenGL ES 2.0 like in a 3D modeling program?

Is there an easy way to re-render dynamic vertices in OpenGL ES 2.0 so that one could, for example, make a modeling program? I understand how to make a dynamic vertex array, but what I don't ...
-1
votes
1answer
258 views

How can one make multiple movable images in OpenGL ES 2.0? [closed]

I was wondering, I've only seen examples of OpenGL ES 2.0 where people have used one or perhaps two images. I didn't see multiple images of where they each had independent movement. What if someone ...
1
vote
1answer
99 views

in an ios open gl es 2 game - is it better to use a few large texture atlas or many small textures

I'm working on new game, this time moving to more 3d objects and open gl es 2. Previous (successful) game was open gl es 1 and mostly 2d. For es 2 I'm developing my own 3d engine. My 3d artist ...
1
vote
1answer
371 views

GL_EXT_shadow_samplers killing my shader

I have the following fragment shader for my scene #extension GL_EXT_shadow_samplers : require ... vec4 color = texture2D(uTextureUnit0, varTexCoord0); if (colorTransformEnabled != 0) { vec3 ...
0
votes
3answers
773 views

Where to run logic update in openGL ES?

Using Canvas with Surfaceview I had a run() method where I would essentially do the following: onDraw(); update(); Where onDraw method would do the rendering and update would update all my game ...
-2
votes
1answer
203 views

Game code structure using openGL / Android [closed]

My game will have 3 activities (splashscreen, options menu and main game). As it stands, each is a separate activity with it's own activity class and GLSurfaceview class. Is this structure the right ...
2
votes
1answer
669 views

Separate renderng thread in Android (OpenGL ES 2.0)

I'm used to mainly working with the Canvas SurfaceView API on Android and have recently been learning openGL ES 2.0 With canvas I know that surfaceView gives you the ability to start a new thread to ...
1
vote
1answer
311 views

Powers of 2 textures in Android 2d games?

I've read a lot about the importance of using powers of 2 png's for textures when using OpenGL ES. However, how does this relate to Google's own documentation regarding the resizing of graphics for ...
0
votes
1answer
361 views

Drawing more that one quad with only one glDrawArray call…?

Edit After initially thinking that my sprite batch test was faster than calling each sprite individually, it appears that is not the case!! :-( With a single set of GL calls for a each sprite, I can ...
2
votes
2answers
2k views

Android: Loading bitmaps without premultiplied alpha (OpenGL ES 2.0)

Is this possible? To load textures in non-premultiplied format (Straight alpha?)? My game has 1 or 2 images which have semi-transparent pixels and I need to be able to fade them in and out but this ...
2
votes
1answer
738 views

How can I tell if OpenGL has finished rendering the current frame?

If I make a call to http://developer.android.com/reference/android/opengl/GLSurfaceView.html#requestRender() from my game loop, how can I tell when OpenGL has finished rendering? I don't want to ...
2
votes
0answers
202 views

iPhone GLSL shader dynamic branching issue

I am trying to pass an array of vec3 as uniform and then iterate through them on each pixel. The size of array varies on situations so I can't make the loop with constant number of iterations. ...
3
votes
1answer
682 views

Proper way to maintain Vertex Buffer Objects

I've started learning WebGL, currently I'm building a 2D lighting system, but there is some confusion going on inside my head. How the lighting works is based on this tutorial ...
0
votes
1answer
410 views

Get back or delete an existing OpenGL object, then change it and draw at new. How?

With OpenGL i'm drawing for example a circle. Can i take this drawn circle back out of the window and change something and then draw it back on the window? Or can i /have to delete it and then draw ...
7
votes
2answers
574 views

What's the best way to draw lots of trees

I'm writing an app which renders a random island planted with trees. The trees are currently two quads, criss-crossed and drawn with textures. I plan to have more complex meshes that form different ...