opengl-es-2.0

Drawing Textured Cube in Android NDK using opengl-es2 will not draw anything

喜夏-厌秋 提交于 2019-12-11 04:06:15
问题 i am trying to draw a textured cube with non-interleaved/seperate buffers for each positions/texture-coordinates/normal buffers. as i am using opengles-2 i am not using VAO. code runs without errors but output is blank. i tried several variations of matrix multiplications but still without success. all help is greatly appreciated. i have limited drawing to a single initialization and a draw call as i want to debug single iteration of the draw loop. ///////////////////////////////BUFFERS//////

Change colour of vertices after they are uploaded using a VBO

末鹿安然 提交于 2019-12-11 03:45:35
问题 EDIT: Working coded example by Apple found at this link: http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/TechniquesforWorkingwithVertexData/TechniquesforWorkingwithVertexData.html After creating the vertices for a fixed grid of 200 x 200 squares, I render it by sending the vertices to the GPU using a VBO. How can I then update the colour of the vertices? The colour of hundreds of vertices will change frequently - every few frames. I

iPhone OpenGLES 2.0 Text Texture w/ strange border (not stroke) issue

▼魔方 西西 提交于 2019-12-11 03:17:51
问题 I'm using the CoreGraphcis to create a text texture. Unfortunately the text renders like this (Text color is same as background to demonstrate the strange border). I've tried playing with stroke colors and borders to I think it is do to OpenGLES 2.0 and not CoreGraphics. // Create default framebuffer object. The backing will be allocated for the current layer in -resizeFromLayer glGenFramebuffers(1, &defaultFramebuffer); glGenRenderbuffers(1, &colorRenderbuffer); glBindFramebuffer(GL

Can't link compiled shaders to program OpenGL ES 2.0 Android

左心房为你撑大大i 提交于 2019-12-11 03:14:39
问题 I have a problem with linking shaders to program in OpenGL ES 2.0. Here's my code package pl.projekcik; import android.content.Context; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.util.logging.Logger; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import util.LoggerConfig; import util.ShaderHelper; import util.TextResourceReader; import static android.opengl

Updating only a horizontal subregion of a texture in OpenGL ES 2.0

我的未来我决定 提交于 2019-12-11 02:54:46
问题 This question is specific to OpenGL ES 2.0 on Android, but there may be work-arounds that use common GL functionality so I'm tagging this as "opengl". tl;dr: is there another way to specify glPixelStorei(GL_UNPACK_ROW_LENGTH) in OpenGL ES 2.0? Because according to the spec, the GL_UNPACK_ROW_LENGTH doesn't exist in OpenGL ES 2.0. I have a texture that I update frequently by calling glTexImage2D , from a fixed region of client memory that is being updated independently. In some cases I know

Shader attribute mat4 not binding correctly (Opengl ES 2.0 Android)

牧云@^-^@ 提交于 2019-12-11 02:52:43
问题 I have the following shader: protected final static String vertexShaderCode = "attribute vec4 vPosition;" + "attribute vec2 texCoord;" + "attribute mat4 uMVPMatrix; \n" + "varying vec2 vTexCoord;" + "void main() {" + " gl_Position = uMVPMatrix * vPosition;" + " vTexCoord = texCoord;" + "}"; I want to pass in the mvp matrix as an attribute, however it doesn't seem to be bound correctly. I'm using auto-assigned binding. When I query the attribute locations after linking the program as follows:

Changing material color on a merged mesh with three js

纵饮孤独 提交于 2019-12-11 02:37:18
问题 Is that possible to interact with the buffer used when merging multiple mesh for changing color on the selected individual mesh ? It's easy to do such thing with a collection of mesh but what about a merged mesh with multiple different material ? 回答1: Depends on what you mean with "changing colors". Note that after merging, the mesh is like any other non-merged mesh. If you mean vertex colors, it would be possibly to iterate over the faces and determine the vertices which color to change

Drawing shape on button click using OpenGL in android

白昼怎懂夜的黑 提交于 2019-12-11 02:19:59
问题 As new to the android OpenGL section.I had downloaded the sample example given on site Displaying Graphics with OpenGL ES so run the downloaded sample and its running with an error and display the output as expected. I had do draw the triangle in the GLSurfaceview and its working fine. The screenshot for the triangle drawn:- Now as the requirement change i have to draw the triangle onclick of the imageview but not on starting the application. Here is the screenshot for the above mention

glClipPlane - Is there an equivalent in webGL?

情到浓时终转凉″ 提交于 2019-12-11 02:16:10
问题 I have a 3D mesh. Is there any possibility to render the sectional view (clipping) like glClipPlane in OpenGL? I am using Three.js r65. The latest shader that I have added is: Fragment Shader: uniform float time; uniform vec2 resolution; varying vec2 vUv; void main( void ) { vec2 position = -1.0 + 2.0 * vUv; float red = abs( sin( position.x * position.y + time / 2.0 ) ); float green = abs( cos( position.x * position.y + time / 3.0 ) ); float blue = abs( cos( position.x * position.y + time / 4

2D OpenGL ES Metaballs on android

时光怂恿深爱的人放手 提交于 2019-12-11 02:14:18
问题 I have an array of points (balls) in 2D-space which I want to be displayed as 2D Metaballs. For learning purposes I implemented it on a canvas by create an array which represents each pixel iterate through this array and set a value depending on the distance to every ball for each pixel iterate again and remove everything below a threshold That works fine but is extremely slow, as expected. I am pretty new to OpenGL and played around with various samples but I did not manage to make 2D OpenGL