OpenGL ES 2.0 emphasizes a programmable 3D graphics pipeline (comparing to fixed-function pipeline of OpenGL ES 1.1).
5
votes
0answers
74 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
96 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
80 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
138 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
42 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 ...
0
votes
0answers
45 views
Android , why GLSurfaceview output is different in Various Devices (Google Nexux7,Samsung Galaxy Note II)
I have created an android app for drawing of lines,circles.. by using
GLSurfaceView in OpenGLES 2.0 like an Auto cad app.
The app works well with Google Nexus 7, in the sense that if we draw a ...
1
vote
0answers
87 views
How to implement OpenGL triple buffering
I'm trying to implement the triple buffering described here ...
0
votes
1answer
52 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
46 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
83 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 ...
0
votes
0answers
24 views
NPOT texture and video memory usage
In this QA, @KromStern is saying 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 ...
2
votes
1answer
59 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
69 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
93 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
119 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
42 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
150 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
55 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};
...
7
votes
1answer
138 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 ...
2
votes
2answers
163 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
0answers
257 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
112 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
208 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
81 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
52 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
68 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
88 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
101 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
145 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
118 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
56 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
77 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
142 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
103 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
51 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
153 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
129 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
129 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 ...
0
votes
0answers
62 views
Strange problem with rendering quads in OpenGL ES 2.0 with custom classses on Android
I have 2 custom classes, one is for drawing quads (Quad) and the other is for drawing quads using VBO's (VBOQuad).
If I create a simple quad and render it like so:
Quad sprite = new Quad();
...
1
vote
1answer
194 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
142 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
143 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
375 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 ...
0
votes
0answers
44 views
Refactoring Sprites to their own classes OpenGL es 2 [closed]
I was following along with http://www.raywenderlich.com/9776/how-to-create-a-simple-2d-iphone-game-with-opengl-es-2-0-and-glkit-part-2 and I've hit a wall. I can't for the life of me figure how to ...
2
votes
0answers
165 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 ...
1
vote
0answers
89 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. ...
2
votes
1answer
129 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
132 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
353 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 ...
1
vote
2answers
113 views
Why doesn't a line draw after instantiating it on a thread other than the renderer thread?
I'm making a 2D game with OpenGL ES 2.0 on Android, as an excuse to learn a bunch of things. I'm drawing many lines to make a grid, but setting everything up takes time and I'd like to render a ...