OpenGL ES 2.0 emphasizes a programmable 3D graphics pipeline (comparing to fixed-function pipeline of OpenGL ES 1.1).
1
vote
3answers
79 views
Reducing APK File Size by using JPG instead of PNG for game background images
I've just finished my (openGL ES 2.0 Android) game and it's almost ready for Alpha-testing.
When I export the application to an APK File, the file is taking up 16MB and I would like to reduce this as ...
1
vote
2answers
75 views
Bad pixels on shader when loading cached binary programs
I have been trying to cache binary shader programs in my game and load them accordingly using "glGetProgramBinaryOES" and "glProgramBinaryOES" respectively.
I was successfully able to cache and load ...
1
vote
1answer
25 views
XY Location scaling with varying density screens
I have a phone with resolution H=1280,W=720,Density=2
I have a tablet with resolution H=1216,W=800,Density=1.331
I drew a rectangle on my phone with corners Left,Top (-1.6,1.55), Right,Bottom ...
0
votes
0answers
40 views
Camera movement in Super Hexagon
I do realize there is no camera in OpenGL ES 2, but from my understanding you can simulate one using view and projection matrices. I'm using Android, by the way. Here's a video of the game, in case ...
0
votes
1answer
73 views
Re-using one texture for multiple OpenGL Quads
I've been looking over my code and I'm just wondering, when I set a texture for say, 20 quads that need to use the same texture, it seems as though I'm creating a new texture each time...... surely ...
0
votes
2answers
28 views
How to obtain the currently bound texture ID in an openGL ES 2.0 project
In my game, I have:
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texID);
Where texID is an integer returned by my setTexture() method. Let's say, in this instance it's 1.
When I bind my textures ...
0
votes
0answers
24 views
Scaling issues with Open GL viewport / scissor box (Trying to draw outside of viewport)
In my game I am currently scaling the viewport so it retains the ratio of my development device like so:
width = (int) Math.min(deviceWidth, deviceHeight * 1.702127659574468); //1.702127659574468 is ...
0
votes
0answers
11 views
Export Blender 3D animation to be played by Android OpenGLES
Below code snippet shows the way to export coordinate of bones:
def export_bone_matrix(armature, bone, label, file_handler):
SystemMatrix = Matrix.Scale(-1, 4, Vector((0, 0, 1))) * ...
0
votes
2answers
65 views
Confusion over GLViewport
I'm hoping someone can help me understand the GLViewport and what happens when we resize it
This will illustrate my confusion....
So, here I have a quad stuck in the middle of the screen. If I ...
8
votes
1answer
86 views
How can I reliably implement GPU skinning in Android?
I'm trying to get character skinning working on Android.
The idea is quite vanilla: I have my skinning matrices, and along with each vertex, I send up to four matrix indices and four corresponding ...
0
votes
0answers
22 views
Deleteing Textures in Android OpenGL ES 2.0
I'm confused about how to delete a previously applied texture.
So, I've applied my texture and am happily rendering it.
I decide I want to delete the texture, so this is what I've tried......
void ...
0
votes
1answer
36 views
Storing object position and rotation
I only superficially understand the idea and I can't find any thorough explanation (partially because I can't find very good keywords to Google - English is not my first language):
Although I ...
1
vote
1answer
67 views
Drawing flaming letters in 3D with OpenGL ES 2.0
I am a bit confused about how to achieve this. What I want is to "draw with flames". I have achieved this with textures successfully, but now my concern is about doing this with particles to achieve ...
0
votes
0answers
33 views
Very basic OpenGL ES 2 error
This is an incredibly simple shader, yet I'm having a lot of trouble understanding what's wrong with it. I'm trying to send a float to my fragment shader. Its purpose is to adjust the alpha of the ...
7
votes
1answer
165 views
How do I reconfigure my GLES frame buffer after a rotation?
Note: In order to keep the question as simple as possible, I am actively changing the body of the question to reflect the current state of affairs, instead of adding stuff at the bottom.
I am ...
0
votes
0answers
36 views
Displaying and updating score in Android (OpenGL ES 2)
I'm using a FrameLayout where I have a GLSurfaceView at the bottom and a few Views on top of it. One of those Views is a TextView that displays the current score.
Here's how I'm updating the score ...
0
votes
1answer
41 views
glGetActiveAttrib on Android NDK
In my code-base I need to link the vertex declarations from a mesh to the attributes of a shader. To do this I retrieve all the attribute names after linking the shader. I use the following code (with ...
0
votes
1answer
80 views
Progress bar in Super Hexagon using OpenGL ES 2 (Android)
I'm wondering how the progress bar in Super Hexagon was made. (see image, top left) Actually I am not very sure how to implement a progress bar at all using OpenGL ES 2 on Android, but I am asking ...
0
votes
2answers
82 views
OpenGL 2.0 - How to swap buffers for color picking
I'm trying to reproduce color picking on iOS, following the technique described here: http://www.lighthouse3d.com/opengl/picking/index.php3?openglway2, with OpenGL ES 2.0.
When the user touches the ...
1
vote
1answer
67 views
Brighter pixels around area (OpenGL ES 2)
I'm trying to achieve an effect like in the image bellow. Basically I will have a 2D texture and I want a small area around a point (let's call it "light source") to be slightly better lit (i.e. be ...
1
vote
1answer
85 views
In 3D camera math, calculate what Z depth is pixel unity for a given FOV
I am working in iOS and OpenGL ES 2.0. Through trial and error I've figured out a frustum to where at a specific z depth pixels drawn are 1 to 1 with my source textures. So 1 pixel in my texture is ...
0
votes
0answers
45 views
Threading in Android OpenGL ES 2.0
Background
I've encountered a strange issue when testing my level-select screen.
I have 20 levels and display the 'select buttons' for them in 2 rows of 10 (I did this rather than display 4 rows of ...
0
votes
1answer
91 views
OpenGL ES 2 jittery camera movement
First of all, I am aware that there's no camera in OpenGL (ES 2), but from my understanding proper manipulation of the projection matrix can simulate the concept of a camera.
What I'm trying to do ...
0
votes
1answer
107 views
Is ETC2 Texture Compression available in OpenGL ES 2.0?
However, I have an ES 2.0 app and would like to use ETC2 texture compression if it is available (i.e. I am running on a device that supports ES 3.0 standard). Is it possible to use ETC2 in ES ...
1
vote
1answer
107 views
OpenGL and atlas
I'm trying to draw element from a texture atlas with OpenGL ES 2.
Currently, I'm drawing my elements using something like that in the shader:
uniform mat4 uCamera;
uniform mat4 uModel;
attribute ...
0
votes
0answers
89 views
Moving objects smoothly, bad perfomance
I just finished developing my mini-game on Android and I got some questions about perfomance and generally "how to": If I have 25+ objects on the creeen (just a polygon with 7-8 angles) its starts to ...
1
vote
2answers
116 views
How can I read from multiple textures in an OpenGL ES 2 shader?
How can I enable more than one texture in OpenGL ES 2 so that I can sample from all of them in my shader? For example, I'm trying to read from two different textures in my shader for the player's car.
...
0
votes
1answer
111 views
Normal Map Issues
I'm experiencing a very strange result in my very simple normal map implementation on iOS 7 - OpenGL ES 2.0. I'm only using the bare parameters necessary and I'm also skipping on all the tangent and ...
1
vote
0answers
129 views
Android and OpenGL, single thread vs double thread
I'm trying to optimize my Android OpenGL ES 2.0 application, and I find myself being CPU bound.
After googling, I've found this, which suggest to use a thread for updating objects, and a thread for ...
10
votes
5answers
1k views
2D collision detection
Let's assume I'm using this character.
How would you implement collision detection for it? Using a bounding box doesn't seem to be a good approximation, because the bird's shape is nowhere near a ...
1
vote
1answer
158 views
How should I implement a Game Over menu in Android?
By Game Over menu, I mean a menu displayed when you die, with an option to play again.
I have two approaches in mind:
Use OpenGL
Have some button textures ready. When the character dies, draw ...
0
votes
0answers
125 views
glsl fragment shader work diffrently on different devices
i'm making a 2d android game where i have a mechanics that allow the player to move the camera away from the main character, and to not allow him to explore the hole world, a have create a Fog shader, ...
1
vote
2answers
131 views
Circular dependency when creating entities
I have the following problem:
I have a a class called Stage, that keeps an list of entities, which it iterates over every update loop, and updates them.
One of these entities might be a weapon (PEW ...
0
votes
0answers
122 views
Async Task for splash screen in OpenGL project
I'm confused over the application of an asyncTask for a simple Android splashscreen. I'm talking specifically about within an OpenGL game.
Because of the nature of OpenGL, 2 things spring to mind ...
1
vote
0answers
125 views
iOS OpenGLES - Multithread Game loop - Render and Update
I am trying to implementing multi-threaded game loop in iOS.
(Actaully, two thread - Render and Update)
This is my structure.
Update Loop
Has logic and at the end of loop, save update state. ...
1
vote
2answers
112 views
Howdo I create differently sized texture atlases for different screen sizes?
I am beginning game development and using texture atlases.
I've created textures based on the resolution 1920x1080, so I created a 1024x1024 size Texture Atlas for storing multiple graphics.
If the ...
6
votes
1answer
210 views
overlapping 3d particles not blending nicely when at the same z
I'm working on a 3d particle emitter. It's going pretty good but I'm still having a problem with triangle sorting.
As you can see in the photos, there are some particles that are not blending ...
1
vote
2answers
101 views
matrix to rotate a vector to a known arbitrary axis
Let's say I have a vector V (v.x,v.y,v.z) which is normalized and points somewhere in 3d space. And that I have another vector Z of (0,0,1). Knowing only these two things I'm looking for a ...
1
vote
2answers
128 views
Adding an angle variance to a 3d vector
I am converting a particle emitter from 2d to 3d.
In the 2d system the original coder used a random angle variance and added it to the angle. So it would be something like:
thisAngle = emitterAngle ...
5
votes
3answers
303 views
How do I send multiple matrices to a vertex shader?
I'm practising animations using bones/skinning. I am trying to send the shader one matrix per vertex. I can think of these two approaches.
Method 1
I have one uniform handle for each bone matrix ...
0
votes
1answer
53 views
What is the correct Order of Operations on OpenGL 2.0 Loading Texture in condense format?
I have come across a problem when I am loading a single texture onto a single quad, and this problem persisted during the planning phases of my project, before starting my development phase. I am ...
3
votes
1answer
118 views
Texture mapping a complex object on openGL ES
I dont have much experience with openGL ES (or openGL), but i do get the general idea of texture mapping, which is each vertex should be mapped for the relevant UV coordinates of the texture we choose ...
2
votes
1answer
217 views
How do I draw an animated object in OpenGL ES?
I have a VBO, which I initialise like this (just an example):
- (void)setupVBOs {
GLuint vertexBuffer;
glGenBuffers(1, &vertexBuffer);
glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
...
0
votes
2answers
117 views
Manage shader parameters
I'm making some test with OpenGL and I've got a problem with my application design. Currently, I've got something like that in pseudo code:
// Ask to draw a given scene.
renderer->drawScene( ...
1
vote
1answer
89 views
Run OpenGL shader on part of a texture
How do I run an OpenGL shader on just a portion of an off screen texture and leave the rest of the texture unmodified? Are there any calls that restrict the sampled pixels to just a rectangle or do I ...
0
votes
1answer
232 views
libgdx game process dies on loading texture atlases
I try to load a lot of texture atlases (10) with approximately 5 (~2048x~2048)(not using PoT) .pngs each. I'm using AssetManager and there is no trouble with it on my pc but when I try it on my tablet ...
0
votes
1answer
182 views
Should I delete the textures I use in OpenGL ES 2 (Android)?
Say I have a skybox and the user can choose out of 2 sets of 6 textures (one for each face of the cube) to use on that skybox. For example if user selects set A, I load the textures ...
2
votes
2answers
134 views
What are the pros. and cons. of different representations a custom geometry format for a mobile based engine?
I am trying to create 3D model importer for my mobile based engine.
These are what I am considering:
Convert .obj file to text based structure like JSON or custom.
So, basically, convert .obj ...
5
votes
1answer
119 views
portal cutoff effect
I want a 3D Mesh to come out of a flat portal. Only the part of the mesh that's coming out of the portal should be rendered, so the mesh should be cut off or sliced until it's fully outside the ...
0
votes
1answer
111 views
Sphere turns to ellipsoid further away from origin (OpenGL ES 2, Android)
I'm not even sure what code to share, but maybe someone's been in a similar situation or has a good suggestion.
I'm basically rendering a sphere in the middle of the screen (placed at (0, 0, 0)) and ...