opengl-es-2.0

Are OpenGL indices and locations the same thing for uniforms and vertex attributes?

坚强是说给别人听的谎言 提交于 2019-12-23 20:12:06
问题 In the OpenGL Reference Pages, some functions are marked as using uniform locations, while other functions are marked as using uniform indices. Are these the same thing? Similarly for vertex attributes, some functions are marked as using vertex attribute indices, while other functions are marked as using vertex attribute locations. Are these the same? 回答1: In your first case, the location for an Uniform is different from the index used for glGetActiveUniform() . For glGetActiveUniform() case,

spherical animation with text for using tag cloud in android app [News Republic]

眉间皱痕 提交于 2019-12-23 17:17:15
问题 I want to create spherical animation in my android app similar to this in News Republic app. I have tried to create a sphere so far but can anyone guide me how to proceed to develop animations like this in android. Do we have to use opengl only or we can achieve it with other alternative option. Also, when the text is clicked it opens the related news in a different screen. EDIT I finally found some solution for this, which is available under this package. But, the animation is not smooth

spherical animation with text for using tag cloud in android app [News Republic]

拜拜、爱过 提交于 2019-12-23 17:14:35
问题 I want to create spherical animation in my android app similar to this in News Republic app. I have tried to create a sphere so far but can anyone guide me how to proceed to develop animations like this in android. Do we have to use opengl only or we can achieve it with other alternative option. Also, when the text is clicked it opens the related news in a different screen. EDIT I finally found some solution for this, which is available under this package. But, the animation is not smooth

Using glVertexAttribPointer and glDrawElements to draw from a packed vertex buffer

房东的猫 提交于 2019-12-23 16:50:23
问题 I have a packed vertex buffer containing postion coordinates aswell as color values for a vertex in the format {X, Y, Z, R, G, B, A}. I am able to display the rectangle properly with a hardcoded color when I alter the fragment shader by taking out the a_Color attribute and hard coding a vec4 value for gl_FragColor but I am not able to pass the color vec4 attribute into the fragment shader (the rectangle won't display in that scenario). What is the correct way to use glVertexAttribPointer(...)

Can you use glVertexAttribPointer to assign a smaller vector to a larger one?

倖福魔咒の 提交于 2019-12-23 09:59:39
问题 From section 5.8 of The OpenGL® ES Shading Language (v1.00, r17) [PDF] (emphasis mine): The assignment operator stores the value of the rvalue-expression into the l-value and returns an r-value with the type and precision of the lvalue-expression. The lvalue-expression and rvalue-expression must have the same type. All desired type-conversions must be specified explicitly via a constructor. So it sounds like doing something like this would not be legal: vec3 my_vec3 = vec3(1, 2, 3); vec4 my

How can i run GLES20.glReadPixels on separate thread in android?

不打扰是莪最后的温柔 提交于 2019-12-23 06:43:36
问题 I am currently working with ARCore to classify images and put objects on the images. But it seems like ARCore camera doesn't provide any way to get the pixelbuffer. then i came accross How to take picture with camera using ARCore and according this we can copy the frame from OpenGL using GLES20.glReadPixels . if i pass each frame at a time my classifier works fine but when i put GLES20.glReadPixels to get the pixel buffer in a separate thread i am getting all zeros. so basically it gives me

How can i run GLES20.glReadPixels on separate thread in android?

断了今生、忘了曾经 提交于 2019-12-23 06:42:00
问题 I am currently working with ARCore to classify images and put objects on the images. But it seems like ARCore camera doesn't provide any way to get the pixelbuffer. then i came accross How to take picture with camera using ARCore and according this we can copy the frame from OpenGL using GLES20.glReadPixels . if i pass each frame at a time my classifier works fine but when i put GLES20.glReadPixels to get the pixel buffer in a separate thread i am getting all zeros. so basically it gives me

Projection of Square onto 2D Plane (OpenGL ES2)

二次信任 提交于 2019-12-23 04:42:30
问题 I'm in the process of creating a coverflow view for android, but I'm running into a little bit of a roadblock when handling clicks on the view. I'm having trouble determining which square is beneath the click. In order to determine which square is clicked, the (X,Y) data from the click event is taken and converted into the opengl view space. The trouble comes when placing this on a square: the transposition, rotation, and compares can all be done in java, but this seems like a huge waste,

iphone opengl es 2.0 non power of two

醉酒当歌 提交于 2019-12-23 04:22:12
问题 I thought the image file size doesn't have to be power of two in 2.0 but when I tried, it just showed black screen. But it works fine with power of two images. Can anyone give me some hint what I am missing or I should do to use NPOT images? Thank you 回答1: OpenGL ES for iOS requires Power-of-Two images, unfortunately, as it is a rather strict implementation (case in point, look at all of the stuff that is not available in OpenGL ES). If your image is non-power-of-two there are a few solutions

Android OpenGL|ES 2.0 Texturing

China☆狼群 提交于 2019-12-23 03:57:13
问题 I am using OpenGL|ES 2.0 to create a simple 2D square. I am struggling to get the textures working. Please help me in this regard. I have attached the code below: GFXUtils: public class GFXUtils { public static final String TAG = "GFXUtils"; public static final int COORDS_PER_VERTEX = 3; public static final int COORDS_PER_TEXTURE = 2; public static int vertexStride = COORDS_PER_VERTEX * 4; // bytes per vertex public static int textureStride = COORDS_PER_TEXTURE * 4; // bytes per vertex public