OpenGL ES 2.0 emphasizes a programmable 3D graphics pipeline (comparing to fixed-function pipeline of OpenGL ES 1.1).
1
vote
1answer
26 views
Help Needed with Shaders
Ok, bear with me, I am a beginner with Google Cardboard programming.
What I have been doing is looking at the TreasureHunter sample app from Google's page and (with the help of documentation and other ...
1
vote
1answer
23 views
alpha test shader 'discard' operation not working - GLES2
I wrote this shader to illustare alpha test action in GLES2 (Galaxy S6).
I think is not working at all cause I don't see any change with or without it.
Is there anything Im missing?
Any syntax error?
...
0
votes
0answers
23 views
FFP Alpha Test shader - function decleration
I'm trying to use FFP_Alpha_Test RTSS from ogre on GLES2 platform.
I added the relevant files and built everything but got an error:
No matching function for call to 'FFP_Alpha_Test'
Fragment Program ...
1
vote
1answer
76 views
how to make a fast fragment shader that converts intensity to saturation?
I have a simple fragment shader that looks like this:
#ifdef GL_ES
precision lowp float;
#endif
varying vec4 v_fragmentColor;
varying vec2 v_texCoord;
uniform vec4 u_desiredColor;
uniform sampler2D ...
0
votes
0answers
18 views
How I can check what type of textures available in current machine?
can someone help to me with this question. I wanna check is specified type of texture available on device. Should I check every type "by my hand", or I can automatically take it from somewhere?
0
votes
1answer
28 views
When which type of draw mode to use?
I wrote Opengl ES wrapper, and I want to know, when I should use
GL_TRIANGLES, GL_TRIANGLES_FAN and GL_TRINAGLES_STRIP
I read difference from OpenGL Red Book, but still doesn't understand what ...
1
vote
1answer
43 views
Indexed draw vs draw array
Lately I wondered, which draw command is faster, drawArrays or drawElements. I know difference between them, drawArrays just draws every vertex in the same order they were provided, and drawElements ...
0
votes
1answer
53 views
OpenGL ES 2.0 Without The Use of Shaders
While refreshing my mind on OpenGL ES, I decided to read a few of the books I brought a while back and search for some tutorials online.
Whilst doing so, I came across many beginner's tutorials that ...
1
vote
1answer
19 views
Fragment shader operations before vector transformations
I feel like I'm misunderstanding how to work with vector/fragment shaders. My vector shader is as follows:
uniform mat4 uVMatrix; // view (camera transformations)
uniform mat4 uMMatrix; // ...
1
vote
0answers
68 views
Libgdx - Building dynamic 3d models with Modelbuilder/MeshPartBuilder while rendering
Context: I'm building a mobile game targeted for android with libgdx. It's an endless highscore based game. The environment/terrain is build dynamically. It's kind of a maze/wall/block terrain. I'm ...
3
votes
0answers
44 views
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. ...
1
vote
1answer
36 views
Point Sprite Size and Coloring OpenGL ES 2.0
I am trying to render point sprites with with variable color, but they are all black. Before I added gl_PointSize = 5.0 they had color.
The environment is Android with C++, I believe OpenGL ES 2.0.
...
1
vote
1answer
32 views
Pitch/Yaw in circle causes undesired Tilt [duplicate]
I've made my own Camera object, with a forward vector as well as a up vector. I happen to be programming in Android using OpenGL ES 2.0 but I think this question is relevant to all frameworks, it ...
0
votes
0answers
48 views
How should I draw a chessboard (with arrows) in an app?
I have to draw a chessboard in an app, which it will be possible perform following operations:
Move pieces with touch (not first priority really)
Draw an arrow from one location to another, to ...
1
vote
2answers
165 views
Why is there no glClear() and glClearColor() method in GL30?
In the GL30 interface, both the methods glClear() and glClearColor() are absent. I tried to call the method Gdx.gl30.glClear(GL30.GL_COLOR_BUFFER_BIT) inside render() but it threw me a null pointer ...
1
vote
0answers
107 views
Making use of the Android GPU debugging tools
I tried following the manual to install the Android GPU debugging tools for android Studio 2.0. Unfortunately it has not been very successful.
I have been following the instructions of the official ...
1
vote
0answers
104 views
How can I build a C++11 vertex attribute class?
How would you build a flexible and efficient vertex attribute class in C++11? What I have:
Vertex attribute roles for using them in shaders:
enum AttributeRole
{
VERTEX0,
TEXCOORD0, ...
...
1
vote
2answers
46 views
OpenGL: Does it make sense to use an Index Buffer With GL_TRIANGLE_FAN?
When trying to draw circles in webGl (You can answer the question even in openGl terms, I'll understand both), I came across the TRIANGLE_FAN flag when calling either glDrawArrays (with only a vertex ...
0
votes
0answers
41 views
Emscripten / webgl lazy rendering?
I compiled existing opengl es 2.0 code to webgl using emscripten. In the desktop version there is lazy rendering mechanism that only renders when required which is basically just saying invalidate ...
2
votes
0answers
109 views
Bilinear filtering by sampling corners of a texel
I'm trying to do bilinear filtering in texels to get the convoluted value of a 3x3 block. Implemented as below:
offsetx = 1/width
offsety = 1/height
Fragment shader:
"varying vec2 vTextureCoord;\n" ...
1
vote
1answer
70 views
How to know when Android OpenGL Context has been preserved?
I am implementing a pause menu for my game in Android.
If the activity pauses and then resume, It lose the OpenGl context.
However if you use setPreserveEGLContextOnPause(true) it MAY preserve the ...
0
votes
1answer
58 views
Opengles 2.0, Replace the black region in the image to make it transparent
I have two textures, Source image A and Overlay B, B is drawed on top of A, I want to replace the black color in B, then make the region of A visible, what should I do?
This is my shader language:
...
3
votes
0answers
76 views
Optimal batching for 2D objects with transparency
I have a collection of 2d objects with transparency. Each object has a depth value to determine draw order and a material. I'm trying to batch them in an optimal way to minimize draw calls. Assume ...
0
votes
1answer
110 views
How can I describe a square in OpenGL ES 2.0?
I need to draw a Tic-Tac-Toe board in Xcode using OpenGL ES 2.0. I am new to graphics programming and can't find good information on drawing a square in opengl es in iOS. I looked at Ray's tutorials, ...
-3
votes
1answer
25 views
OpenGL ES 2 inheriting issues [closed]
I am Having an issue where one of my classes will not inherit the other ones variable value. In the class which is inherited. It shows the value of the float just fine. But when I go to the Class ...
0
votes
0answers
33 views
Simple OpenGL ES 2 program fails
I'm stuck on a very simple OpenGL ES application from 2 days now. I am a "beginner" OpenGL developer, and this is my first attempt at the ES version on android. This is a VERY simple app, the usual ...
1
vote
0answers
232 views
how to temporarily turn off/on multisampling for an OpenGL ES 2.0 render context in Android?
In my OpenGL ES 2.0 Android app, I render to an EGL surface with >= 2 samples; I obtain this surface by passing:
EGL14.EGL_SAMPLES, 2
as part of the attribute_list argument for egl.eglChooseconfig() ...
1
vote
1answer
65 views
Effect of vertex winding on normals and shading
I have implemented a Phong and Gourand shader for a triangle mesh that is being imported from an STL file. It appears to be working fairly allright but some triangles seem to be what I can only ...
1
vote
1answer
89 views
OpenGL ES 2.0 facet lighting
I am trying to figure out if there is a way to achieve facet lighting in OpenGL ES 2.0 without extensions. I know it is possible if I don't used indexed vertices but I don't really want to do that ...
5
votes
1answer
361 views
Calculated normals for mesh not working
I am trying to implement a 3D mesh viewer with C++ and OpenGL ES 2. I am currently struggling with the calculation of the normals for the vertices, or at least I think that is where the problem lies......
2
votes
0answers
123 views
blending with OpenGL glBlendFunc and glBlendEquation
I want to draw a bunch of images in front of a background. Where images overlap, I want those to be blended together (for now, using a mix of 0.5 source * 0.5 destination color every time an image ...
1
vote
1answer
53 views
Rendering sprites on a Mali-400 MP device
I started developing a small cross platform game engine using OpenGL, I am working actually on a sprite batch renderer.
Everything is working fine on OS X, iOS, Win32, and some Android Devices. Here ...
0
votes
1answer
101 views
drawing a horizon / sky in OpenGL ES 2.0
I want to render a sky: My camera is at the origin, and I want there to be a white background for all world coordinates with z < 0 (would normally be considered y > 0, but I have a different ...
0
votes
1answer
69 views
Opengles 2.0 multi Textures fade out one by one
I have multi textures, A was drawed on top of B, B was on top of C ...., ( like Picture 1) .I want to fade out A first, then B will appear and fade out either... But when A fade out, background color ...
1
vote
0answers
47 views
OpenGL ES 2.0: Highly variable time spent in GLES20.glDrawArrays(). How to find the cause?
How can I debug why the time take to issue exactly the same GL commands to render a frame, especially the call to GLES20.glDrawArrays(), is highly variable even when there is no garbage collection and ...
3
votes
0answers
40 views
When I add in Java transformationMatrix I can't see images? [closed]
When I add in Java transformationMatrix I can't see images moving but when I remove it I can see why and how to fix it? Any ideas how to fix it?
My Renderer class:
public class Renderer {
...
2
votes
0answers
164 views
Texture coordinates for custom geometry in SceneKit ios9
I am trying to texture the a custom plane shape I created in scenekit on iOS9. I need the texture to spread out and stretch over the entire surface. I have a vertex and fragment shader on an ...
2
votes
1answer
118 views
Get Stencil buffer working iOS OpenGL ES 2.0
I have been trying to get this work but either get black screen or reporting error when using XCode to analyze the GL code like below. Any help appreciated. I am using Swift here if that making a ...
4
votes
1answer
76 views
Shaders: packing 4 textures into a single RGBA - slower?
I'm experiencing something really strange on an iOS mobile device. I have 4 textures, and after some profiling it seems, that doing four separate grayscale texture reads is faster, than reading the ...
2
votes
1answer
325 views
Stencil Buffer not working as expected in OpenGL ES 2.0 (Android)
I'm trying to get to grips with the stencil buffer.
Apart from setting up viewport, camera, etc, my OpenGL ES 2.0 initialisation code is:
GLES20.glDisable(GLES20.GL_CULL_FACE);
GLES20.glDisable(...
6
votes
2answers
450 views
What's the best practice for a progress bar in OpenGL ES 2.0?
My attempt: I make a texture (could be a single colour or otherwise), and then stretch that texture from a minimum 0 up to a maximum max value. This works, but leaves me rather dissatisfied for a ...
1
vote
2answers
395 views
Optimize drawing “different” sprites in OpenGL ES 2.0 (batching?)
I started experimenting with OpenGL ES 2.0, and I'm trying to figure out a way to optimize/batch sprite drawing, where sprites only have the texture in common, but differ in the following properties:
...
1
vote
0answers
186 views
How do I draw multiple irregular polygons with OpenGL ES?
In this post I was asking how to program a map of a Risk-like game.
Now that the map is pretty coded, both client and server-side, I'd like to finally draw the map.
I'll try to keep least broad as ...
3
votes
1answer
164 views
Do shader compilers typically know not to look up unused texture channels?
I have a texture that's from the color attachment of an FBO in OpenGL ES 2.0, so I have limited control over the number of channels in the image.
Suppose I only need the color from the R channel of ...
0
votes
1answer
484 views
Setting up a Visual Studio project for OpenGL and OpenGL ES
I want to make a small game with OpenGL and glew for desktop, android and web.
So far I know how to set up a project for opengl and a project for opengl es but I would like to have the game source ...
3
votes
1answer
251 views
How to deal with overlapping black parts of Light mask textures?
I am using this masking texture for a dynamic lighting effect in my game:
It looks beautiful until two lights begin to overlap:
This is obviously because the textures are overlapping when I draw ...
3
votes
1answer
82 views
OpenGL ES God Ray Precision error
I have encountered the following (i think) precision error.
(missing link need 10 rep)
My source of inspiration was:
(missing link need 10 rep)
On the PC everything works fine, but on android it ...
0
votes
1answer
224 views
How to send dynamic data to a vertex shader OpenGL ES 2 Android
I'm very new to Android development and OpenGL ES 2.0.
I have been working through a book called "OpenGL ES 2 for Android A Quick Start Guide" which has been useful, but at times I get a bit lost as ...
0
votes
1answer
65 views
Best approach for level specific textures
TL;DR: Best way to handle level-specific textures without overkilling memory usage and killing performance and keeping things clean in OpenGL for mobile (also lower-end devices) and desktop using ...
0
votes
0answers
248 views
OpenGL - Make two images blend together
I have 2 images that are .png and they mix together, The problem is that one overwrite the other. I know that the draw order matters, but In that case I should redraw the icons 2 times ( there is a ...