opengl-es

glLinkProgram crashes even though glCompileShader does not return any error

坚强是说给别人听的谎言 提交于 2020-01-06 14:03:29
问题 I am trying to make the native code from https://software.intel.com/sites/default/files/managed/79/e5/OpenGL%20ES%20Tessellation.zip work on my Samsung Galaxy S5. I have disabled Tessellation in the code. I have also changed the code to use OpenGLS ES 3.0. The program runs and successfully compiles the attached shader but when the program calls glLinkProgram with compiled shader, glLinkProgram crashes. The program calls glError when compiling the shader and there is no error at that time. Can

Opencv vs Opengl for image filters

白昼怎懂夜的黑 提交于 2020-01-06 09:08:13
问题 I'm a complete beginner in image processing thing so please do excuse me if my question is foolish .Basically I'm trying to develope an image filter app .So, when I googled I came to know that both openCV and openGL can be used for this purpose . But I'm not sure which language would be the best means by speed or efficiency ? Can anyone please enlighten me about this topic a bit? 回答1: OpenGL stands for Open Graphics Library . It is a 3D graphic rendering library. OpenCV stands for Open

Efficiency comparison between invididual textures and a texture sheet in OpenGL ES

两盒软妹~` 提交于 2020-01-06 08:36:32
问题 It's generally regarded that using a big texture 'image' full of many smaller textures (think font sheets) is faster than having each texture separate. How big is the improvement in performance? Would it be noticeably faster or will it be a minor improvement? 回答1: Would it be noticeably faster or will it be a minor improvement? It depends on how many textures you are using. If you have few textures, you can be fine with separate textures. If you are making a big world containing of lots of

Switching current GL_COLOR_ATTACMENT in FBO

a 夏天 提交于 2020-01-06 07:31:10
问题 Then we create buffer object we can specify many colour attachments from 0 to N glBindFramebuffer(GL_FRAMEBUFFER, some_buffer); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,some_texture_0, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D,some_texture_1, 0); But then we draw to buffer, how to control which colour attachment we use in FBO? (default is 0), or multiple colour attachments works different way? glBindFramebuffer(GL

Problem with opengles to show an image

浪尽此生 提交于 2020-01-06 05:47:25
问题 I use xcode Opengl App template to create a sample. I am new to opengles, and having to try re-write the 'render' method in ES1Renderer.m I try create a texture and show it on the screen, but nothing showed. Someone can help me ? I have no idea how to fix it: - (void)render { int imageW = 16; int imageH = 16; GLubyte *textureData = (GLubyte *) malloc(imageW * imageH << 2); for (int i = 0; i < imageW * imageH << 2; i++) { textureData[i]= 0xff & i; } GLuint textureId; glGenTextures(1,

How to intercept touchscreen events in Android OpenGL ES?

喜夏-厌秋 提交于 2020-01-06 03:54:04
问题 How exactly do you intercept touchscreen events for OpenGL ES games in Android? Also, if the game is 3D, how do you know if the user touched an object in the background? Thanks. 回答1: Override onTouchEvent(MotionEvent e) into your class extending GlsurfaceView. @Override public boolean onTouchEvent(MotionEvent e) { float x = e.getX(); float y = e.getY(); switch (e.getAction()) { case MotionEvent.ACTION_MOVE: float dx = x - mPreviousX; float dy = y - mPreviousY; mRenderer.mAngleX += dx * TOUCH

Why GLES20.glGetAttribLocation returns different values for different devices?

拜拜、爱过 提交于 2020-01-06 03:41:57
问题 I'm trying using OpenGL2.0 and create multiple cubes in 3D space, for android devices. The code it runs perfectly in some devices, but not in others, and i don't know why... (All devices have OpenGL 2.0 supported, and have recent android versions [5.0 or 6.0]) I only know that the problem is in a -1 return value (see down) int vertexShader = loadGLShader(GLES20.GL_VERTEX_SHADER, R.raw.vertex); int gridShader = loadGLShader(GLES20.GL_FRAGMENT_SHADER, R.raw.grid_fragment); int passthroughShader

How to Change CCTexture2D Color

核能气质少年 提交于 2020-01-06 02:22:41
问题 I have a polygon that I fill using a texture and glDrawArray (using the method described in this tutorial: http://www.raywenderlich.com/32954/how-to-create-a-game-like-tiny-wings-with-cocos2d-2-x-part-1). I want to be able to fill my polygon using a solid color, which is generated at random during gameplay. To do this using the technique from the tutorial, I need to dynamically create a texture that is just a solid color (for example, I might want to generate a 1x1 red square and use that to

quartz 2d / openGl / cocos2d image distortion in iphone by moving vertices for 2.5d iphone game

醉酒当歌 提交于 2020-01-06 01:58:29
问题 We are trying to achieve the following in an iphone game: Using 2d png files, set-up a scene that seems 3d. As the user moves the device, the individual png files would warp/distort accordingly to give the effect of depth. example of a scene: an empty room, 5 walls and a chair in the middle. = 6 png files layered. We have successfully accomplished this using native functions like skew and scale. By applying transformations to the various walls and the chair, as the device is tilted moved, the

Change GlSurfaceView renderer

假如想象 提交于 2020-01-05 17:41:42
问题 I looked all over the net in order to find out if its possible to change the renderer of a GLSurfaceView on the flight. The reason is that I want to change the OpenGl program, and initiate all the attributes and unified params from its vertex and fragment shader and I don't want the any change would require to create a brand new GLSurfaceView with a brand new Renderer. It seems like reasonable operation that should be doable. 回答1: Note: I haven't implemented the following. GLSurfaceView