opengl-es-2.0

How does glBufferData know which VBO to work on?

北慕城南 提交于 2019-12-02 06:06:00
问题 Here is the formal declaration for glBufferData which is used to populate a VBO: void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); What is confusing, however, is that you can have multiple VBOs, but this function does not require a handle to a particular VBO, so how does it know which VBO you are intending? The target parameter can be either GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER but my understanding is that you can have more than one of each of these.

GLSurfaceView not appearing over MapView

别说谁变了你拦得住时间么 提交于 2019-12-02 04:22:24
My goal is to use OpenGL ES 2.0 with Google Maps. I would like to create an app that follows the user as they are traveling from point A to point B. I realize that this can be done using Google Maps addPolyline to draw a line, but I want to use OpenGL instead in order to show overlap of paths. I'm currently receiving an error which is due to incorrectly setting up the GLSurfaceView. My code in the GoogleMapsTracker class is as follows: private MapView mapView; private GoogleMap map; private GLSurfaceView mGLSurfaceView; /** * Use this factory method to create a new instance of * this fragment

iOS how to mask the image background color

人走茶凉 提交于 2019-12-02 03:53:16
I want to do following thing within in my iOS app: user can draw something on white background paper. my app allows user to capture the drawn image. Here the image will capture with background white color. finally from the captured image i need to mask the white background color and just get the image alone into UIImage object. I completed the steps 1 and 2. But i do not have any idea how to do the last step. Is there any openCV library that i can use it with my iOS app?. Any help that might be really appreciated. Well, since OpenCV itself is THE library , I guess that you are looking for a

What object's state does glEnableVertexAttribArray modify?

[亡魂溺海] 提交于 2019-12-02 03:05:19
I think I understand what glEnableVertexAttribArray does -- it activates a particular attribute of a program (please correct me if I am wrong). What I don't understand though is which object stores this information. Is it the program object? That is, if I do: glUseProgram(program); glEnableVertexAttribArray(0); and then later on do: glUseProgram(program); glDrawArray(...); will the attribute at location 0 be enabled? Or is it modifying some global state which needs to be reset every time before each draw call? Or is it modifying the state of the VAO? If so, what about in OpenGL ES 2.0, where

Android OpenGL ES2.0 Texture Swapping

折月煮酒 提交于 2019-12-02 00:23:07
First off I am new to OpenGL, but on my phone (Motorola Bionic) the following code works as intended. GLES20.glActiveTexture(GLES20.GL_TEXTURE1); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTowerTextureHandle); GLES20.glActiveTexture(GLES20.GL_TEXTURE2); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTowerNormalHandle); GLES20.glActiveTexture(GLES20.GL_TEXTURE3); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mFrostTextureHandle); GLES20.glActiveTexture(GLES20.GL_TEXTURE4); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mFrostNormalHandle); GLES20.glActiveTexture(GLES20.GL_TEXTURE5); GLES20.glBindTexture

OpenGL ES 2.x: any way to reuse depth buffer for off-screen and on-screen rendering?

爷,独闯天下 提交于 2019-12-01 20:24:18
问题 I'm doing 2-pass rendering, where for the first pass I'm rendering to a texture and for the second pass I'm rendering to the screen. I'm rendering the same polygons in both passes, but I'm using different shaders. In particular, the second pass uses a shader that takes the texture generated by the first pass as a parameter. Currently my first pass has a framebuffer with a texture for the color attachment and a renderbuffer for the depth attachment (stenciling is disabled), while the second

OpenGL ES 2.x: any way to reuse depth buffer for off-screen and on-screen rendering?

夙愿已清 提交于 2019-12-01 19:37:57
I'm doing 2-pass rendering, where for the first pass I'm rendering to a texture and for the second pass I'm rendering to the screen. I'm rendering the same polygons in both passes, but I'm using different shaders. In particular, the second pass uses a shader that takes the texture generated by the first pass as a parameter. Currently my first pass has a framebuffer with a texture for the color attachment and a renderbuffer for the depth attachment (stenciling is disabled), while the second pass renders to the default framebuffer (0). It occurred to me that since I'm rendering exactly the same

Android GLES20.glBlendEquation not working?

旧巷老猫 提交于 2019-12-01 18:26:27
问题 Ive been trying to make a 2.5D engine with depth and normal map textures for a few weeks now, not unlike whats used here Linky. After thinking the drawing of a depth map in the fragment shader from a texture was impossible due to ES 2.0 missing the gl_fragDepth variable I found a tutorial for iOS where they used glBlendEquation with the mode GL_MIN/GL_MAX to "fake" depth buffering of the fragment to a framebuffer-texture Linky. Unfortunely GLES20.glBlendEquation makes the application crash on

Android OpenGL ES 2.0 Only Limited To 16 Textures In Memory?

北城以北 提交于 2019-12-01 18:15:23
Basically while I was working on an app in Android Studio using OpenGL ES 2.0, I ran into a big problem that I can't wrap my head around, and it's been bugging me for about a week. So, anytime I load more than 16, maybe 17 textures of any size in memory, and attempt to display them in 2D through either my emulator in Genymotion or my ASUS tablet, it either begins to display different images than what I was binding at that particular index, or not display at all. Yet if I run it through my Samsung Galaxy S6, it runs fine. However if I load 16 textures or less, it works all around in all devices

Android GLES20.glBlendEquation not working?

会有一股神秘感。 提交于 2019-12-01 17:51:24
Ive been trying to make a 2.5D engine with depth and normal map textures for a few weeks now, not unlike whats used here Linky . After thinking the drawing of a depth map in the fragment shader from a texture was impossible due to ES 2.0 missing the gl_fragDepth variable I found a tutorial for iOS where they used glBlendEquation with the mode GL_MIN/GL_MAX to "fake" depth buffering of the fragment to a framebuffer-texture Linky . Unfortunely GLES20.glBlendEquation makes the application crash on both my phones (SGS 1/2) with UnsupportedOperationException. So Im wondering if anyone has used this