opengl-es-2.0

Full screen background texture with OpenGL performance issue (iPad)

試著忘記壹切 提交于 2019-12-13 11:44:19
问题 I am quite puzzled with the poor performance I'm seeing when drawing a full screen background using a textured triangle mesh in OpenGL: drawing just the background and nothing else maxes out at 40 fps using the most basic shader, and 50 fps using the default pipeline. While 40 fps doesn't seem too bad, adding anything else on top of that makes the fps drop, and considering I need to draw 100-200 other meshes on top of that, I end up with a paltry 15 fps that is simply not usable. I have

Using gluUnProject to map touches to x,y cords on z=0 plane in Android OpenGL ES 2.0

Deadly 提交于 2019-12-13 08:16:19
问题 I've drawn a grid at z=0 in OpenGL 2.0 ES, and just want to convert touch inputs to x/y coordinates on that plane. It seems like this is best done through ray tracing, which involves running gluUnProject on 0 and 1, then creating a ray, solving that ray for z=0? I found this code, but it is OpenGL ES 1.0: i-schuetz / Android_OpenGL_Picking Screenshot of app running so you can see camera distortion. My code on Github, only 4 files. The unproject function I'm trying to write is in MyGLRenderer

Android OpenGL ES 2: Introduction to VBOs

瘦欲@ 提交于 2019-12-13 08:02:07
问题 Can someone offer a tutorial for using vertex buffer objects (VBOs) in Android? I am working on a 2D HUD which is drawn using OpenGL ES 2 on Android. 回答1: The best OpenGL ES tutorials are not specifically for Android, but the way VBOs are used will be directly portable. The best OpenGL ES examples are in the PowerVR SDK. There is also a collection of relevant articles on my blog that will help too. 回答2: Here's some: Most basic working vbo example http://www.opengl.org/wiki/VBO_-_just_examples

GLES20 calls in onDrawFrame causes long delay

回眸只為那壹抹淺笑 提交于 2019-12-13 05:17:42
问题 I have written a game in which when onDrawFrame() is called I update the game state first (game logic and the buffers for drawing) and then proceed to do the actual drawings. On the Moto G and Nexus 7 everything works smoothly and each onDrawFrame() call takes only between 1-5ms. However, on the Samsung Galaxy S3, 90% of the time the onDrawFrame() call takes as long as 30-50ms to update. Further investigating the issue I found the problem wholly lies on the first render method which I attach

Seekbar progress changed but GLSurface view not affected

谁说我不能喝 提交于 2019-12-13 04:57:32
问题 I am developing app in which i want to give brightness to my GLsurfaceView on progress changed of Seekbar. The progress changed but GLsurfaceView can't be effected means i can't increment or decrement brightness eventhough color are also not applied to GLSurfaceview.. I have tried for that. But nothing happen. Appropriate for your help Thanks in Advance!! My Code is Here: EffectActivity.java: public class EffectsActivity extends FragmentActivity implements OnTouchListener, OnClickListener,

WebGL - stripes when using multiple textures

喜欢而已 提交于 2019-12-13 04:16:41
问题 I'm using three textures in my WebGL program, and I get a striped/overlapping effect. The first texture I bind is OK, but sequential textures get the effect. Here's my vertex data format (x,y,z,s,t,textureIndex,textureName) -5.0 0.0 -5.0 0.0 0.0 1 WL01 -5.0 0.0 5.0 0.0 1.0 1 WL01 5.0 0.0 5.0 1.0 1.0 1 WL01 -5.0 0.0 -5.0 0.0 0.0 1 WL01 5.0 0.0 -5.0 1.0 0.0 1 WL01 5.0 0.0 5.0 1.0 1.0 1 WL01 -1.0 1.0 -4.0 0.0 1.0 2 WL02 -1.0 0.0 -4.0 0.0 0.0 2 WL02 -0.0 0.0 -4.0 1.0 0.0 2 WL02 -1.0 1.0 -4.0 0.0

How to draw circle on OpenGL ES 2.0 cross platform?

≯℡__Kan透↙ 提交于 2019-12-13 03:05:44
问题 Ive been teaching myself to program on openGL ES 2.0 for the past 2 weeks however I am struggling to draw certain objects. I am using Mosync to do my coding in as I can programme for all platforms. So far I have written a programme to draw a triangle and another to draw a square. Im looking for a way to draw a circle, I know I have do define the centre, radius, angle and resolution but I dont know how to go about making it work. Can I draw the circle straight from draw() or do I have to

Draw multiple objects with textures

邮差的信 提交于 2019-12-13 02:05:16
问题 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; //Manipulation with matrix ... glVertexAttribPointer(userData->positionLoc, 3, GL_FLOAT, GL_FALSE, 0, cubeFaces); //in cubeFaces coordinates verticles cube glVertexAttribPointer(userData->normalLoc, 3, GL_FLOAT, GL_FALSE, 0, cubeFaces); //for normals (use in

What kind of shader for 2D games (ie. Super Mario)

空扰寡人 提交于 2019-12-13 00:18:05
问题 I've been trying to figure out how to use OpenGL ES 2.0 for 2D. So far I think I have a handle on most things. But the one thing that I haven't figured out is what to do for the shaders? I understand that you set up the camera/view and the lights in the shader, but I don't want shadows or any kind of sign of lighting. Basically I just want to move sprites around the screen and have the sprites look exactly like they did when I drew them in photoshop. Anyone have an example of a shader that

Translation to world coordinates

你说的曾经没有我的故事 提交于 2019-12-12 21:16:02
问题 I have mouse coordinates: mousePos , a matrix view view , and a perspective projection matrix pMatrix . I translate the coordinates into the world: I find the inverse projection matrix and the inverse matrix view and multiply by the coordinates of the mouse. The coordinates of the origin is z = 4 , the coordinates of the end is z = -100 . In the first case, I get the coordinates mouseDir1 = (-0.1985 0.02887 4) , and in the second case mouseDir2 = (-0.1985 0.02887 -100) . Why are the