Tagged Questions

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

0
votes
2answers
28 views

Getting the correct texture from an Atlas

I'm writing an OpenGL ES (2.0) app and have a custom Quad class which draws a textured quad for my sprites. Currently, I put the textures of any sprites of the same size into a single file or atlas, ...
2
votes
1answer
144 views

Avoiding memory allocation in Android game development

For obvious reasons, allocating memory on the fly in Android game development is not recommended. For example: http://developer.android.com/training/articles/perf-tips.html: There are two basic ...
0
votes
0answers
40 views

Shadow mapping comparing depth in GLSL

I've been trying to figure out how to compare against my shadow map, which has a shader that just does the following: gl_FragColor.r = gl_FragCoord.z; And my vertex shader for the render pass does ...
0
votes
1answer
47 views

OBJ Model not being rendered properly in OpenGL ES 2 android app

I have an Android OpenGL ES 2 app that loads an .OBJ model using Assimp and renders the same. The vertices data is stored in a object declared like this : class CGameObject { public: struct _Mesh { ...
0
votes
1answer
43 views

Problem rendering simple OBJ model using assimp in android app

I am trying to load an OBJ model (http://pastebin.com/usGFkf4e) into an Android app using Assimp 3.1.1 Assimp model loaded like this : bool CGameObject::LoadModelFromFile(AAssetManager *amgr, ...
1
vote
2answers
30 views

Convert trianlge mesh to group of Line segments

I have a 3D .OBJ model file, that is loaded in my OpenGL ES 2 android application using Assimp library. All the faces are triangulated. I want to draw the wireframe for my mesh. In OpenGL we have ...
3
votes
1answer
101 views

How to specify colour in a single 32 bit value

I'm writing my first game using OpenGL 2 ES (for Android), and I've currently got a particle engine and some player sprites running successfully. I'm using 4 floats for the colour of each particle ...
1
vote
1answer
144 views

OpenGL (ES 2.0) Function Dependencies

In OpenGL (ES 2.0), there are many functions that can be called in any order, and still others that must be called after other functions had been called and not before. For example, attaching a shader ...
1
vote
2answers
54 views

Vertex Skinning Looks Messy on Real Android Device using Monodroid

I have no problem doing the "vertex skinning" for three-dimensional animation. All goes well when using the emulator (and genymotion). However, when run on a real device (such as Samsung and Lenovo) ...
1
vote
1answer
92 views

OpenGL ES draw pre-rendered background onto depth buffer

I want to create a scene with 2D pre-rendered background and 3D models for characters (like those classic Final fantasy games). For the background, I have 2 textures: one to be displayed, with ...
1
vote
0answers
23 views

Android OpenGLES, getting number of fragments passed depth test/Occlusion Query?

Afeter reading many blogs and searching on Internet, I did not get any sloution for getting number of fragments/pixels which are occludded or not occludded of the object on OpenGL ES3.0 Android ...
0
votes
1answer
39 views

Offset a camera/render without changing perspective

I need to offset a render so that the perspective / vanishing point doesn't change. Or another way to look at it is that I need to adjust the vanishing point in my view so that instead of being at ...
0
votes
0answers
19 views

Reversed OpenGL ES 2.0 Rotation Code (Android)

My rotation code seems to be 'reversed' - I'll explain further... In all the tutorials / examples I've seen online, there is something like this: public void rotate(float centerX, float centerY, ...
1
vote
1answer
79 views

Interpolating rotated objects

I've finally got interpolation working to 'smooth' out movement, however it doesn't seem to work for objects that are rotating (around their own center) - when I try to do this, the objects in ...
0
votes
0answers
69 views

geometry shader shim for opengl es 2.0

I just have a few months of OpenGL experience, just starting to get the hang of it. I find geometry/vertex/fragment shaders to be very powerful. You have a few parameters that translates into a ...
3
votes
1answer
95 views

Desaturate texture using mask in OpenGL 2

I have a very large texture i am using as background and i want to apply a filter to a small part of it, the "small part" is defined by the alpha layer of another texture i have (which is still ...
0
votes
0answers
65 views

How to pause animation when leaderboard is displayed?

I've notived in some games from the Play Store that when you access the Play Games Leaderboard, the game itself is still visible in the background (as if the leaderboard activity is 'transparent') and ...
7
votes
2answers
196 views

How to avoid subpixel values in a resolution independent 2D game with orthographic projection?

I'm trying to do resolution independent rendering of moving sprites in a 2D game. My plan is work in a fixed coordinate system in my world (for example 960x540) and use orthographic projection to ...
0
votes
1answer
72 views

Opengl ES 2.0: Is there a way to use less resources to draw in-game background texture

1.Should my in-game background be drawn with my game loop renderer, or if 2.I don't want to draw my background image every frame in my main renderer since it could possibly be a heavy job while the ...
1
vote
1answer
78 views

Does scaling affect performance in OpenGL? [closed]

I've never been able to understand the best practice in this context. I usually want to ship my game with as minimum size as possible. So whereever possible, I try to use scaling of my graphics. Let's ...
1
vote
1answer
111 views

cocos2d-x “immediate mode”?

I have some c++ game code that draws the game state on each game-loop cycle in "immediate mode". By that I mean that the game code does not add the sprites to be drawn to any sort of "scene graph" or ...
1
vote
0answers
82 views

OpenGL ES 2.0 state management best practices [closed]

I use a game engine with dynamic sprite batching for 2D games on mobile platforms (MOAI SDK). It already handles redundant state changes pretty well - with the use of texture atlases it only flushes ...
0
votes
1answer
46 views

Batching and object's transformation

I'm trying to implement batching in my game (Sprite batching and 3D Mesh batching), I've read a lot of documentation about that but I don't understand something: When each object have is own ...
0
votes
0answers
40 views

Barycentric vertex coordinates in GLES 2.0

I have a certain set of polygons, which are stored in a vertex buffer and an index buffer. The polygons are textureless and normalless. The polygons are dynamic, their buffers get constantly emptied ...
0
votes
1answer
82 views

Java Buffers and OpenGL ES 2.0 (Android)

I've been trying to come up with a good solution for preloading textures asynchronously, but in Android with OpenGL ES you cannot create a texture out of context. Would the proper solution be to load ...
1
vote
1answer
69 views

Replace each white spot of image to radial gradient

Recently, I have read article about sun shader (XNA Sun Shader) and decided to implement it using OpenGL ES 2.0. But I faced with a problem connected with shader: I have two textures, one of them is ...
0
votes
0answers
213 views

Android - OpenGL ES 2 - Cube with different texture in each side

I need to create a 3d cube, with a different texture on each side. Here is my cube class, which my other classes extend: import java.nio.ByteBuffer; import java.nio.ByteOrder; import ...
0
votes
2answers
375 views

How to change from 60FPS to 30FPS while keeping things smooth?

Here is my current game loop: final int ticksPerSecond = 60; final int skipTicks = (1000 / ticksPerSecond); float dt = 1f/ticksPerSecond; while(System.currentTimeMillis() > nextGameTick ...
0
votes
0answers
106 views

Vsync and Gameloops

I was about to publish my app but I tested it on a cheap Android tablet. It's anew tablet, but a cheap / low spec one. The game runs, but is pretty choppy. I'm made a discovery that quite surprised ...
1
vote
3answers
388 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
107 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
52 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
49 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
123 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
67 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
73 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 ...
1
vote
0answers
165 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
3answers
470 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
177 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
54 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
63 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
156 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
75 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
265 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
121 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
101 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
202 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
259 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
123 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
180 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 ...