Questions tagged [opengl-es2]

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

OpenGL ES 2.0 combines a version of the OpenGL Shading Language for programming vertex and fragment shaders that has been adapted for embedded platforms, together with a streamlined API from OpenGL ES 1.1 that has removed any fixed functionality that can be easily replaced by shader programs, to minimize the cost and power consumption of advanced programmable graphics subsystems.

391 questions
6
votes
2 answers

How can I use an unsigned int as a GLSL attribute for OpenGL ES 2

I'm having trouble finding conclusive information on this, but it seems like I can't pass integer attributes to GLSL for OpenGL ES or that if I do they'll be converted to float. I need a value between the range [0-65535] for each vertex. If I pass…
Pris
  • 904
  • 2
  • 11
  • 19
5
votes
4 answers

How to visually "connect" skybox edges with terrain model

I'm working on a simple airplane game where I use skybox cube rendered using disabled depth test. Very close to the bottom side of the skybox is my terrain model. What bothers me is that the terrain is not connected to the skybox bottom. This is not…
David
  • 210
  • 3
  • 10
4
votes
0 answers

How to measure the refresh rate of a display in OpenGL ES?

I am working on OpenGL ES application which is rendering 60 frames per second which is equal to my Monitor refresh rate. My problem is: if I make Swapinterval 0, I am getting a FPS value above 200. I am able to reduce it to 60, but I have taken…
anil
  • 41
  • 1
3
votes
1 answer

gluLookAt on OpenGLES2

gluLookAt is not available in OpenGLES 2. OpenGLES 2 is also using floats not doubles. Taking the description on the gluLookAt man-page, I have implemented it like this: void graphics_t::set_mvp_look_at(const vec_t& eye,const vec_t& centre,const…
Will
  • 6,977
  • 4
  • 36
  • 59
2
votes
0 answers

How to create a shining sun in OpenGL ES 2 (on Android)

Let's say I created a space scene in OpenGL ES 2 similar to this one: At the moment my sun is just a small texture similar to the one in the image that I place somewhere far, but it obviously looks very static. How would I make my sun shine & look…
async
  • 745
  • 1
  • 7
  • 23
2
votes
1 answer

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 the CPU side of program and call draw-call…
Martin Perry
  • 1,106
  • 1
  • 12
  • 29
2
votes
1 answer

Maintain performance and precision with a large vertex buffer?

I have a world with 100s of simple objects on screen at once. Most objects don't have more than 40-50 vertices. The vertex coordinates for these objects are very large (planetary scale), so I use the 'floating origin' method to draw my data (actual…
Pris
  • 904
  • 2
  • 11
  • 19
1
vote
1 answer

Draw multiple objects with textures

I want to draw cubes using textures. void OperateWithMainMatrix(ESContext* esContext, GLfloat offsetX, GLfloat offsetY, GLfloat offsetZ) { UserData *userData = (UserData*) esContext->userData; ESMatrix modelview; ESMatrix perspective; …
Simplex
  • 113
  • 5
1
vote
1 answer

glVertexAttribPointer alters completely different shader program

My program contains two shader programs in it. The following code is for preparing one of the shader program's attributes: int positionHandle2 = glGetAttribLocation(programAColorUTranslate,…
cpp plus 1
  • 19
  • 6
1
vote
1 answer

GLES2 GL_BGR undeclared?

I tried to bind a bitmap texture. This bitmap is BGR format, and I'm trying to use glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_BGR, GL_UNSIGNED_BYTE, data), but during compile, error: 'GL_BGR' undeclared appears. I checked…
0
votes
1 answer

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 partially understand some things (next paragraph), my…
async
  • 745
  • 1
  • 7
  • 23
0
votes
1 answer

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 it looks fine. However, if I choose to render the…
async
  • 745
  • 1
  • 7
  • 23
0
votes
1 answer

Swaying tree in OpenGL ES 2

I've seen this many times, but I have no idea what's the best way to achieve it. I am looking for something close to, for example, this: Lonely Tree Live Wallpaper I have two approaches in mind: one would be to make an animation in, say, Blender and…
async
  • 745
  • 1
  • 7
  • 23
0
votes
1 answer

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 framebuffer. However, I only get a fraction of the…
async
  • 745
  • 1
  • 7
  • 23
0
votes
1 answer

How can I determine where objects can be seen from a given perspective?

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 in diameter. I want to create an arbitrary grid…
Tim Reddy
  • 215
  • 3
  • 7
1
2