opengl-es-2.0

OpenGL ES 2 on Android: how to use VBOs

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-31 05:02:28
问题 this question is similar to something I asked here Android OpenGL ES 2: Introduction to VBOs however I tried multiple aproaches since then and I still haven't succeeded, so I think posting another question where I offer aditional details would be a better aproach. I am new to OpenGL ES 2 on Android (I have never worked with another OpenGL, I just need to draw something for an app I am developing for Android) and I would very much like to understand how to use VBOs. I tried to modify this

Issue when porting from OpenGL 1.1 to OpenGL-ES 2.0

浪子不回头ぞ 提交于 2019-12-29 09:42:20
问题 this is my opengl-es 2.0 code : { for (surfnum=0;surfnum<surftotal;surfnum++){ for (i=0;i<triNum[surfnum];i++){ GLfloat *Vertices[] = { triArray[surfnum][i].normpt1, triArray[surfnum][i].normpt2,triArray[surfnum][i].normpt3}; glGenBuffers(1, &ui32Vbo); glBindBuffer(GL_ARRAY_BUFFER, ui32Vbo); unsigned int uiSize = 3 * (sizeof(GLfloat) * 1); glBufferData(GL_ARRAY_BUFFER, uiSize,*Vertices, GL_STATIC_DRAW); } } } for(int i = 0; i < 80000; ++i) { glClear(GL_COLOR_BUFFER_BIT); int i32Location =

Android emulator black screen with “GPU emulation - yes”

别来无恙 提交于 2019-12-29 01:51:32
问题 I'm trying to use the new feature of the android avd features "GPU emulation - yes" It's needed to use GLES2.0 on the emulator. However, when I turn that on, the screen of the emulator goes blank. Here is the output when I call it from command line. 回答1: For those having the same problem and having a nvidia card with optimus... Just install ironhide! sudo apt-add-repository ppa:mj-casalogic/ironhide sudo apt-get update sudo apt-get upgrade sudo apt-get install ironhide Then follow the

Drawing a sphere in OpenGL ES

半城伤御伤魂 提交于 2019-12-27 11:14:13
问题 I want to draw a sphere, I know how to do it in OpenGL using calls such as glBegin() & glEnd(). But there is nothing in ES. Suggestions/Tutorial links? 回答1: Since you've tagged this with OpenGL ES 2.0, let me suggest an alternative approach for creating smooth spheres, and that's to draw them as raytraced impostors. Rather than calculate the many vertices you'll need to replicate a smooth sphere, you can take advantage of the fact that a sphere looks pretty much the same from any angle. To do

OpenGL ES20 - Light a cube, how to get normals?

ぃ、小莉子 提交于 2019-12-25 16:57:23
问题 To add some lightning to my OpenGL ES20 cube, I need to calculate the normals for each plane. I've found a "tutorial" on lightning, but they simply hard-coded the normals into the cube, which appears to me as not the best option, since it seems limited? So my approach to the cube is as follows: private float[] mVertices = { -1, -1, -1, // bottom left 1, -1, -1, // bottom right back 1, 1, -1, // top right -1, 1, -1, // top left -1, -1, 1, // bottom left 1, -1, 1, // bottom right front 1, 1, 1,

Libgdx Android - GL Thread (NullPointerException) & Missing Class File

妖精的绣舞 提交于 2019-12-25 10:19:30
问题 i'm using the LibGdx framework to create a game and I'm using Eclipse 4.4 (Luna). Whilst i'm debugging my application this method is breaking. @Override public void run() { setName("GLThread " + getId()); if (LOG_THREADS) { Log.i("GLThread", "starting tid=" + getId()); } try { guardedRun(); } catch (InterruptedException e) { // fall thru and exit normally } finally { sGLThreadManager.threadExiting(this); } } inside the GLSurfaceView Android class, with the stack trace: Thread [GLThread 232]

Open GL ES creating Off-screen

心不动则不痛 提交于 2019-12-25 09:44:43
问题 I am stuck with the following while creating OFF-SCREEN surface using OpenGL ES 2.0 : 1. How to create Off-Screen surface using eglCreatePixmapSurface()? 2. eglCreatePixmapSurface() API takes EGLNativePixmaptype as parameter, what is EGLNativePixmaptype ? how to find its Structure definiton? Can i make it on my own? ( In my Code base its declare as void * ) 3.Once the drawing is done on a Native Pixmap surface, how to access my Native Pixmap data? I have searched in internet alot but could

Open GL ES creating Off-screen

本小妞迷上赌 提交于 2019-12-25 09:44:08
问题 I am stuck with the following while creating OFF-SCREEN surface using OpenGL ES 2.0 : 1. How to create Off-Screen surface using eglCreatePixmapSurface()? 2. eglCreatePixmapSurface() API takes EGLNativePixmaptype as parameter, what is EGLNativePixmaptype ? how to find its Structure definiton? Can i make it on my own? ( In my Code base its declare as void * ) 3.Once the drawing is done on a Native Pixmap surface, how to access my Native Pixmap data? I have searched in internet alot but could

GLES20.glBlend*(): UnsupportedOperationException - what is unsupported on which Android devices?

假装没事ソ 提交于 2019-12-25 07:34:05
问题 To be able to experiment with various OpenGL Blending setups, I included the following code in my GLSurfaceView.Renderer 's onSurfaceCreated() method, the whole project being set up for API level 8: GLES20.glEnable(GLES20.GL_BLEND); GLES20.glBlendFuncSeparate(GLES20.GL_SRC_ALPHA, [etc...]); GLES20.glBlendEquationSeparate(GLES20.GL_FUNC_ADD, [etc...]); All was going well on my AVD with host GPU support (besides my disappointment regarding the missing GL_MAX , that is), but when I installed the

Programmatically defined view in interface builder

谁都会走 提交于 2019-12-25 03:46:09
问题 I have created an OpenGL ES 2.0 view that takes up the iPad's whole screen and I am rendering some things to it. now I want to resize the view to make it smaller and then add some components to control the content of the opengl view. this view is completely defined programmatically but my goal, because I want to add in some controls, is to use interface builder. how do I import this OpenGLView into interface builder? 回答1: I've figured out how to do it. You simply create a UIView in IB and