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

15
votes
2answers
572 views

OpenGL: Where shoud I place shaders?

I'm trying to learn OpenGL ES 2.0 and I'm wondering what is the most common practice to "manage" shaders. I'm asking this question because in the examples I've found (like the one included in the API ...
15
votes
3answers
6k views

Is deferred rendering/shading possible with OpenGL ES 2.0 ?

I asked this on StackOverflow, but it might make more sense here: Has anyone implemented deferred rendering/shading under OpenGL ES 2.0? It doesn't support MRTs, so with only one color buffer, it's ...
10
votes
5answers
2k 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 ...
9
votes
3answers
4k views

How can I bend an object in OpenGL?

Is there a way one could bend an object, like a cylinder or a plane using OpenGL? I'm an OpenGL beginner (I'm using OpenGL ES 2.0, if that matters, although I suspect, math matters most in this case, ...
8
votes
1answer
139 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 ...
8
votes
1answer
575 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 ...
7
votes
2answers
5k 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 ...
7
votes
2answers
593 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 ...
7
votes
1answer
2k views

OpenGL ES create stencil effect using texture

Environment This is the environment I am working in: OpenGL ES 2.0 iPhone Simulator & iPhone 4 iMac 27" using NVIDIA GeForce GTX 680MX 2048 MB Hope that helps. The Problem Been searching ...
7
votes
2answers
175 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 ...
7
votes
1answer
1k views

How can I organize render and transformation data in a scalable fashion?

I am writing for OpenGL 2.0 and in the future porting to OpenGL ES 2.0. I only use VBOs and shaders (no immediate mode, no vertex arrays). I already have working solutions, they just... feel wrong. ...
7
votes
1answer
1k 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; ...
7
votes
1answer
213 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 ...
6
votes
1answer
237 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 ...
6
votes
1answer
421 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 ...
6
votes
1answer
1k views

OpenGL ES 2.0 Best Practices / Architecture Guide

I've recently started working with OpenGL (ES 2.0) on the Android. While there is lots of documentation about the basics, I can't seem to find much about the overall architecture of OpenGL. In ...
6
votes
1answer
707 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 ...
6
votes
4answers
866 views

Impact of variable-length loops on GPU shaders

Its popular to render procedural content inside the GPU e.g. in the demoscene (drawing a single quad to fill the screen and letting the GPU compute the pixels). Ray marching is popular: This means ...
6
votes
1answer
176 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 ...
6
votes
1answer
618 views

FBO rendering different result between Galaxy S2 and S3

I'm working on a pong game and have recently set up FBO rendering so that I can apply some post-processing shaders. This proceeds as so: Bind texture A to framebuffer Draw balls Bind texture B to ...
6
votes
2answers
1k views

Getting the number of fragments which passed the depth test

In "modern" environments, the "NV Occlusion Query" extension provides a method to get the number of fragments which passed the depth test. However, on the iPad / iPhone using OpenGL ES, the extension ...
6
votes
2answers
299 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. ...
5
votes
4answers
4k views

Geometry instancing in OpenGL ES 2.0

I am planning to do geometry instancing in OpenGL ES 2.0 Basically I plan to render the same geometry(a chair) maybe 1000 times in my scene. What is the best way to do this in OpenGL ES 2.0? I am ...
5
votes
4answers
2k views

Should we always prefer OpenGL ES version 2 over version 1.x

OpengGL ES version 2 goes a long way into changing the development paradigm that was established with OpenGL ES 1.x. You have shaders which you can chain together to apply varios effects/transforms to ...
5
votes
2answers
1k views

OpenGL 3.0+ framebuffer to texture/images

I need a way to capture what is rendered on screen, i have read about glReadPixels but it looks really slow. Can you suggest a more efficient or just an alternative way for just copying what is ...
5
votes
4answers
689 views

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 ...
5
votes
1answer
121 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 ...
5
votes
1answer
523 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 ...
5
votes
2answers
630 views

Draws fine in full OpenGL; not drawing anything in Chrome NaCL

I'm appealing to people's psychic debugging skills: I have an OpenGL app that uses shaders and attributes in uploaded VBOs exclusively. It runs fine on the desktop (Linux with integrated Intel ...
5
votes
1answer
1k views

Optional samplers in shaders

I have a scene. Sometimes I draw untextured, coloured, semi-transparent triangles, sometimes I texture them, and I draw a lot of both in a fairly interleaved manner. In a fixed function pipeline the ...
5
votes
3answers
428 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 ...
4
votes
1answer
985 views

Multiplication for MVP matrices: Any benefits to doing so within the vertex shader?

I'd like to understand under what circumstances (if any) it is worth doing MVP matrix multiplication inside a vertex shader. The vertex shader is run once per vertex, and a single mesh typically ...
4
votes
3answers
4k views

OpenGL ES and Screen Coordinates

Is there anyway I can make OpenGL ES 2.0 to accept coordinates (for Vextex for example) in int meaning the pixels instead of the default float system? Also how can I set the point (0,0) to be at the ...
4
votes
1answer
768 views

Integration of LibRocket and Android

I am using OpenGL ES 2.0 to create a 2D game for Android 2.2 and was planning on using LibRocket for the GUI. Does anyone have any links or knowledge they would share on how to integrate LibRocket ...
4
votes
2answers
353 views

Shadow artifacts caused by filtering

I'm working on a shadow-mapping implementation for an OpenGLES 2.0 environment (Stage3D in Flash to be exact). This is how my current implementation works: Render the scene to backbuffer. Render ...
4
votes
2answers
869 views

What is Khronos EGL?

I see that modern OpenGL related code uses EGL, i can't get good resources for this so i ask here: what exactly is EGL ? if a platform supports OpenGL ES 2.0+ or OpenGL 3.0+ i can presume that will ...
4
votes
1answer
840 views

OpenGL ES 2.0 texture distortion on large geometry

OpenGL ES 2.0 has serious precision issues with texture sampling - I've seen topics with a similar problem, but I haven't seen a real solution to this "distorted OpenGL ES 2.0 texture" problem yet. ...
4
votes
1answer
1k views

OpenGL ES 2 shaders for drawing buildings and roads like Google Maps does

I'm trying to create a shader that'll give me an effect similar to what buildings and roads look like on 3D Google Maps. You can see the effect interactively if you enable WebGL at maps.google.com, ...
4
votes
3answers
564 views

OpenGL ES 2.0 - How to batch draw particles that have unique translations, rotations, scales, and alphas?

I've combined all of my vertex data for many particles into a single array. How would I batch draw all of those particles in a manner that preserves their unique translations? Any code examples ...
4
votes
1answer
1k views

How can I create an orthographic display that handles different screen dimensions?

I'm trying to create an iPad/iPhone game using GLES2.0 that contains a 3D scene with a heads-up-display/GUI overlaid on the top. However, this problem would also apply if I were to port my game to a ...
4
votes
1answer
164 views

GetData() error creating framebuffer [closed]

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 = ...
3
votes
3answers
2k views

How can I make a shader effect that looks like a lightly shaded pencil drawing?

I want to make a shader effect using OpenGL ES 2.0 that looks like this image: I'm not sure if this image was painted or is the result of some filter, but I want to create a shader that produces ...
3
votes
2answers
2k views

Can I use PBOs for textures in iOS?

As far as I can see, there is no GL_PIXEL_UNPACK_BUFFER. Also, the OpenGL ES 2.0 specification (and as far as I know, no iOS device currently supports OpenGL ES > 2.0) states that glMapBufferOES() can ...
3
votes
1answer
696 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 ...
3
votes
4answers
594 views

Benefits of upgrading from OpenGL ES 1.1 to 2.0 on iOS

I have an animated 3D iPhone game that I first wrote using OpenGL ES 1.1 in late 2009. After many updates to the rest of the game, the OpenGL ES 1.1 code still runs fine under iOS 6, but I'm ...
3
votes
2answers
1k views

What is causing these visual artifacts on my OpenGL sprites?

What could be the cause of the defects in my characters sprite? I am using OpenGL ES 2.0. I draw my sprites in a sprite batch that uses UV coordinates from one large texture atlas. If you look around ...
3
votes
1answer
2k views

How should I move 2D objects in OpenGL ES 2?

I am a bit confused about what I need to move a basic square. Should I use a translation matrix or just change the object vertices? Which one is better? I use a simple vertex shader, gl_Position = ...
3
votes
2answers
1k 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: ...
3
votes
2answers
718 views

OpenGL sprites and point size limitation

I'm developing a simple particle system that should be able to perform on mobile devices (iOS, Andorid). My plan was to use GL_POINT_SPRITE/GL_PROGRAM_POINT_SIZE method because of it's efficiency ...
3
votes
1answer
3k views

Sea water shader using only fragment processor

I have a game that runs on mobile devices (OpenGL ES 2.0) and for which I would like to create some sea water using the shaders. Now, the plane on which the sea water texture will be has only 4 ...