opengl-es-2.0

Learning OpenGLES 2.0 on iOS [closed]

放肆的年华 提交于 2019-11-26 15:02:55
问题 I'm a beginner with OpenGL ES 2.0 and I'm looking for a good book/resource that will help me with my learning. I've found several books: OpenGL® ES 2.0 Programming Guide iPhone 3D Programming: Developing Graphical Applications with OpenGL ES but reading the Amazon reviews I saw that they either assume previous knowledge with OpenGL or are not written specifically for iOS. (I know OpenGL should be easy to port, but I'm looking for a book/resource with examples in C, not C++, that talks about

In OpenGL ES 2.0 / GLSL, where do you need precision specifiers?

南笙酒味 提交于 2019-11-26 12:55:46
问题 Does the variable that you\'re stuffing values into dictate what precision you\'re working with, to the right of the equals sign? For example, is there any difference, of meaning, to the precision specifier here: gl_FragColor = lowp vec4(1); Here\'s another example: lowp float floaty = 1. * 2.; floaty = lowp 1. * lowp 2.; And if you take some floats, and create a vector or matrix from them, will that vector or matrix take on the precision of the values you stuff it with, or will those values

OpenGL ES2 Alpha test problems

二次信任 提交于 2019-11-26 11:23:00
I am rendering in 3D multiple objects with textures that have alpha. All the textures load fine but when I try to render them in front of each other I get the following: Left is what I have. Right is what it should be. The grid is just to help visualize the perspective. The texture in front of the red circle texture is clipped. I searched around for an answer and it says for me to use: GLES20.glEnable( GLES20.GL_BLEND ); GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA ); But I am using it and it still isn't working. My setup in which I correctly placed in the

How to render Android's YUV-NV21 camera image on the background in libgdx with OpenGLES 2.0 in real-time?

爱⌒轻易说出口 提交于 2019-11-26 10:17:48
问题 Unlike Android, I\'m relatively new to GL/libgdx. The task I need to solve, namely rendering the Android camera\'s YUV-NV21 preview image to the screen background inside libgdx in real time is multi-faceted. Here are the main concerns: Android camera\'s preview image is only guaranteed to be in the YUV-NV21 space (and in the similar YV12 space where U and V channels are not interleaved but grouped). Assuming that most modern devices will provide implicit RGB conversion is VERY wrong, e.g the

Android OpenGL ES 2.0 emulator

ぃ、小莉子 提交于 2019-11-26 08:24:52
问题 Well i have a device which supports OpenGl ES 2.0 (HTC Desire), and of course deploy app on device much faster then on emulator. Default android emulator does not support 2.0, androidX86 project and similiar androbox project does not support native code (NDK) so even Hello-Jni crash on them (all samples works fine on standart AVD except Hello-GL2 sample ofc), don\'t know supports they a OpenGL ES 2.0 or not, please tell me. So if there is a development in native way (NDK) with OpenGl 2.0

How to draw a circle using VBO in ES2.0

半城伤御伤魂 提交于 2019-11-26 07:49:34
问题 I am trying to develop an ES 2.0 application in Linux environment. My target GPU is Fujitsu ruby MB86298 . To optimize the performance I have decided to use the VBO concept. I am very new to VBOs. I rendered basic primitives like triangle and quads using VBO where I have less no vertices . For rendering crown using a VBO, I computed all the vertices(more than 200). Now I am finding difficulty in sending this data of 200 vertices to the VBO.I cannot manually enter the all the vertex data and

Perspective correct texturing of trapezoid in OpenGL ES 2.0

▼魔方 西西 提交于 2019-11-26 07:35:48
问题 I have drawn a textured trapezoid, however the result does not appear as I had intended. Instead of appearing as a single unbroken quadrilateral, a discontinuity occurs at the diagonal line where its two comprising triangles meet. This illustration demonstrates the issue: (Note: the last image is not intended to be a 100% faithful representation, but it should get the point across.) The trapezoid is being drawn using GL_TRIANGLE_STRIP in OpenGL ES 2.0 (on an iPhone). It\'s being drawn

Explicit vs Automatic attribute location binding for OpenGL shaders

血红的双手。 提交于 2019-11-26 06:56:43
问题 When setting up attribute locations for an OpenGL shader program, you are faced with two options: glBindAttribLocation() before linking to explicitly define an attribute location. or glGetAttribLocation() after linking to obtain an automatically assigned attribute location. What is the utility for using one over the other? And which one, if any, is preferred in practice? 回答1: I know one good reason to prefer explicit location definition. Consider that you hold your geometry data in Vertex

Appropriate multiplication of matrices for rotation/translation

只谈情不闲聊 提交于 2019-11-26 05:39:13
问题 In order to rotate/translate object (rotation only about z-axis and translation only in xy plane) not just w.r.t to global center (device center) but also w.r.t other arbitrary points, I created an algorithm, which is correct (because all senior coders I have discussed with consider it correct), but it is taking a lot of time to remove an undesired translation in the implementation (algorithm was created on August 4 and was implemented on the same day, since then the code has been revised 15

OpenGL ES2 Alpha test problems

痞子三分冷 提交于 2019-11-26 02:57:50
问题 I am rendering in 3D multiple objects with textures that have alpha. All the textures load fine but when I try to render them in front of each other I get the following: Left is what I have. Right is what it should be. The grid is just to help visualize the perspective. The texture in front of the red circle texture is clipped. I searched around for an answer and it says for me to use: GLES20.glEnable( GLES20.GL_BLEND ); GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA );