OpenGL ES 2.0 emphasizes a programmable 3D graphics pipeline (comparing to fixed-function pipeline of OpenGL ES 1.1).
0
votes
0answers
18 views
Create quad from texture and screen metrics
If I have a texture with known metrics (pixel size, byte type) and a GL surface to render to of a know density and measures, and I want to draw a quad composed of two triangles that correspond to the ...
0
votes
0answers
8 views
Android OpenGL ES 2 framebuffer not working properly
I'm trying to understand how framebuffers work. In order to achieve that, I want to draw a very basic triangle to a framebuffer texture and then draw the resulting texture to a quad on the default ...
1
vote
1answer
78 views
Fragment shader seems to floor() imprecisely
I'm trying to interpolate coordinates in my fragment shader. Unfortunately if close to the upper edge the interpolated value of fVertexInteger seems to be rounded up instead of beeing floored. This ...
-1
votes
1answer
88 views
What's wrong with this Open GL ES 2.0. Shader?
I just can't understand this. The code works perfectly on the emulator(Which is supposed to give more problems than phones…), but when I try it on a LG-E610 it doesn't compile the vertex shader. This ...
0
votes
1answer
71 views
Android : glowing/pulsing line/triangle
I would like to create a simple Android app using Opengl ES 2.0 that is showing a simple shape (like line or triangle) that is glowing and pulsing like Nexus X logo in this video : ...
1
vote
1answer
84 views
OpenGL ES 2.0. Sprite Sheet Animation
I've found a bunch of tutorials on how to make this work on Open GL 1 & 1.1 but I can't find it for 2.0.
I would work it out by loading the texture and use a matrix on the vertex shader to move ...
0
votes
1answer
49 views
Drawing a random x,y grid of objects within a prespective
I'm wrapping my head around OpenGL ES 2.0 and I think I'm trying to do something very simple, but I think the math may be eluding me.
I created a simple, flat-ish cylinder in Blender that is 2 units ...
0
votes
1answer
76 views
How to use multiple textures in OpenGL ES 2.0?
I am working in OpenGL ES 2.0.
I load two png images as my textures with the libSOIL. I need to use one of them as the texture for the background and another one as the texture of a rotating cube.
...
1
vote
1answer
77 views
What is w componet [duplicate]
What is the W component on graphics programming. I read a blog about opengl that says that w must be equal to either 0 or 1 here. But the book I am currently reading has put w component to more than 1 ...
0
votes
0answers
26 views
Cylinder scrolling / wrap-around world using shaders?
I am making a 2D game using OpenGL ES 2.0 (libgdx), where the world will wrap-around itself on Y-axis.
Apart from implementing the "modulo" method in my rendering code, I'm wondering whether it's ...
0
votes
1answer
42 views
Timing Calculations for Opengl ES 2.0 draw calls
I am drawing a cube in OpenGL ES 2.0 in Linux.
I am calculating the time taken for each frame using below function
#define NANO 1000000000
#define NANO_TO_MICRO(x) ((x)/1000)
uint64_t getTick()
{
...
0
votes
0answers
29 views
Particle system lifetimes in OpenGL ES 2
I don't know how to work with my particle's lifetimes. My design is simple: each particle has a position, a speed and a lifetime. At each frame, each particle should update its position like this:
...
1
vote
1answer
103 views
android: How to apply pinch zoom and pan to 2D GLSurfaceView
I want to apply pinch zoom and panning effect on GLSurfaceView. It is Image editor, so It would not be 3D object. I tried to implement using these following links:
...
0
votes
1answer
48 views
Working with floats in OpenGL ES 2
Are there any reasons or situations one would use in their shader float(1) over just 1.0 ?
0
votes
0answers
43 views
Moving clouds in OpenGL ES 2
I'm trying to implement a cloudy sky like the one in this video: https://www.youtube.com/watch?v=IGOL0OyiJ6s
Basically what I want is to have a scene and then the above effect in the background: huge ...
1
vote
2answers
56 views
Error while reading TGA file and doing Texture Cube map
In my program, i read a TGA file with a function like this:
char* LoadTGA(char* filename, int* width, int* height, int* bpp);
As you can see, this function: return a char array of image data ...
1
vote
1answer
111 views
What is faster - loop in shader vs draw-call
I am doing some program, that can be written in two ways.
render full screen quad and send some additional info to fragment
shader. But in fragment shader I need to perform for-loop
Move the loop to ...
5
votes
1answer
127 views
OpenGL ES 2.0 obscured texture is visible
Hi, I am using LibGDX and OpenGL 2.0 to create a game. So far I have created two meshes. The front mesh is the one with the brown circle texture and another mesh on the top with a green to white ...
0
votes
0answers
72 views
Error when create FrameBuffer: GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
I'm using libgdx, to create some program. I need used some operation in framebuffer. For this operation I create new framebuffer, after this operation I'm call in framebuffer dispose(). When I create ...
0
votes
1answer
111 views
Drawing Text on a scene
I am not sure if I am missing something but I was thinking about how text entities are drawn on a scene, are they drawn with an offset depending on the length of the text? I notice that when I add a ...
6
votes
2answers
197 views
Implementing realistic sun reflection on a sea
I'm drawing a 3d rendered island which has a day / night cycle and a sun that rises and sets over water.
The sea is rendered with a fragment shader derived from this Blinn-Phong tutorial.
...
4
votes
1answer
92 views
GetData() error creating framebuffer
I'm currently porting a game written in C# with XNA library to Android with Monogame.
I have a Texture2D and i'm trying to get an array of uint in this way:
Texture2d textureDeform = ...
0
votes
1answer
48 views
Version number not supported by gl2 in andengine
I am new to andengine. From various forums, i got to know that my system should support hardware virtulisation. I have installed "Intel X86" and my system didn't throw any problem regarding "HAX" now. ...
0
votes
1answer
59 views
OpenGLES 2.0 batching method and do not draw inactive object
I am researching about "batching" objects for one big VBO and reduce draw call.
These are what I am doing now:
Create interleaved VBO based on texture or render state (like Blending)
So, for ...
1
vote
0answers
61 views
How do you tell OpenGL ES 2.0 to use a texture as the depth buffer?
I want to render a scene with an outline post processing effect in OpenGL ES 2.0.
First I render all the opaque objects. Then I use a post processing shader
for silhouette detection that uses the ...
0
votes
1answer
113 views
GLSL: What's generally better for converting a -1 or 1 value to 0 or 1?
I'm writing a shader for rendering both sides of triangles with different colors. I have a value mediump float back = dot(V, N) which is positive if the normal faces away from the camera and negative ...
3
votes
1answer
190 views
Sprite sheet textures picking up edges of adjacent texture
I have a custom sprite routine (openGL 2.0) which uses a simple sprite sheet (my textures are arranged horizontally next to each other).
So, for example, here is a test sprite sheet with 2 simple ...
1
vote
1answer
45 views
Orthogonal projection matrix affecting z-buffer on one device
I am experimenting using Matrix.orthoM for a isometric projection, rather than Matrix.frustumM.
On one device, the z buffering does not appear to be working correctly and I get a cut away effect seen ...
1
vote
2answers
110 views
OpenGL ES - DrawCalls count - bottleneck?
I am newbie to OpenGL ES (so far, I used mainly DX11). Now for my scene, I have about 100 draw calls. I can use instancing, but only about half of objects can be instanced, so draw calls count would ...
-2
votes
1answer
81 views
Can't get indices with VBO working [closed]
I'm learning opengl for a few days only. Now I'm trying to use indices for my cube, but can't get it working, I don't see anything on screen.
struct Vertex
{
GLfloat position[3];
GLfloat ...
0
votes
1answer
71 views
When to call GLBindTexture when using a spite-sheet?
Originally, I was using individual textures (ie, individual .png files) for my sprite's animation and recently altered my code so that I could put all my animation frames into 1 file (so it basically ...
0
votes
0answers
26 views
Problems with GLES2 and NativeActivity
I have a NativeActivity that uses the following to set the background...
static const char gVertexShader[] =
"attribute vec4 vPosition;\n"
"void main() {\n"
" ...
5
votes
1answer
128 views
Sprite with alpha Blending in 3D world
I'm working on a game in a 3D world with elements 2D only (Like Don't starve game) for Android and IOS.
Currently, I've managed "Sprite" without alpha blending, I've just put a condition in the pixel ...
1
vote
2answers
147 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
121 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 ...
6
votes
2answers
1k 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
89 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
122 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
111 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
119 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
155 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
68 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
78 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
177 views
How to implement OpenGL triple buffering
I'm trying to implement the triple buffering described here ...
0
votes
1answer
78 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
114 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
327 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
1answer
62 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
110 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
103 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);
...