opengl-es

Texture wrap mode repeat is not working

杀马特。学长 韩版系。学妹 提交于 2019-12-24 02:41:07
问题 I am using the Android mobile platform, with OpenGL ES 2.0. When I make a texture like so, the textures in my scene draw correctly //Generate there texture pointer GLES20.glGenTextures(1, textureHandle, 0); // parameters - we have to make sure we clamp the textures to the edges!!! GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S,GLES20.GL_CLAMP_TO_EDGE); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL

failed to bind EAGLDrawable in CADisplayLink render loop

纵然是瞬间 提交于 2019-12-24 02:22:20
问题 i use CADisplayLink render-loop callback to render a serial of image textures with openGLes. after CADisplayLink's first callback called, i just get these error output Failed to bind EAGLDrawable: <CAEAGLLayer: 0x946bb40> to GL_RENDERBUFFER 2 Failed to make complete framebuffer object 8cd6 i setup the renderBuffer&frameBuffer and call glFramebufferRenderbuffer in controller's viewDidLoad stage, the return of glCheckFramebufferStatus is fine in that stage. this is the code I'm using. /

Fragment shader without gl_FragColor explicitly set?

人盡茶涼 提交于 2019-12-24 01:54:09
问题 Is not writing anything to gl_FragColor defined as equivalent of doing a discard or simply setting gl_FragColor to vec4(0, 0, 0, 0) ? (For the record, I'm asking this as I'm creating shaders which only writes to gl_FragDepth, for lighting purposes.) 回答1: From the GLSL 4.5 specs... The following fragment output variables are available in a fragment shader when using the compatibility profile: out vec4 gl_FragColor; out vec4 gl_FragData[gl_MaxDrawBuffers]; Writing to gl_FragColor specifies the

Fragment shader without gl_FragColor explicitly set?

泄露秘密 提交于 2019-12-24 01:53:57
问题 Is not writing anything to gl_FragColor defined as equivalent of doing a discard or simply setting gl_FragColor to vec4(0, 0, 0, 0) ? (For the record, I'm asking this as I'm creating shaders which only writes to gl_FragDepth, for lighting purposes.) 回答1: From the GLSL 4.5 specs... The following fragment output variables are available in a fragment shader when using the compatibility profile: out vec4 gl_FragColor; out vec4 gl_FragData[gl_MaxDrawBuffers]; Writing to gl_FragColor specifies the

openGL render to texture in iPhone fails when MSAA is enabled

浪子不回头ぞ 提交于 2019-12-24 01:44:30
问题 My render to texture iPhone code only works if I disable MSAA, otherwise all I get is a black texture. What could be the cause of the problem? Here is my code: glViewport(0,0, target->_Width, target->_Height); glClear(GL_COLOR_BUFFER_BIT Or GL_DEPTH_BUFFER_BIT Or GL_STENCIL_BUFFER_BIT); glBindTexture(GL_TEXTURE_2D, target->_Handle); // render stuff here glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, target->_Width, target->_Height, 0); glBindTexture(GL_TEXTURE_2D, 0); 回答1: Apparently, when

Draw an Image based texture in openGl android(Wear)

馋奶兔 提交于 2019-12-24 01:36:09
问题 I am drawing an image based texture using opengl in android, But the image is drawn partially only shown below my coding @Override public void onGlContextCreated() { super.onGlContextCreated(); shaders = new ShadersDla(); float[] vts = { // x, y, s, t. -1, 1, 1, 1, -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0 }; // AllocateDirect prevents the GC moving this memory. vtBuffer = ByteBuffer.allocateDirect(vts.length * 4) .order(ByteOrder.nativeOrder()) .asFloatBuffer(); vtBuffer.put(vts); } @Override

Circle shape clipping with opengl-es in cocos2d

雨燕双飞 提交于 2019-12-24 01:18:00
问题 I'm trying to make a circle shape clipping on a CCSprite in cocos2d, after searching a lot, i tried the open gl glScissor method, i achieve an squared clipping over my sprite. But, i need to make it a circle, and it seems to be impossible to do with the glScissor. I kept trying and I found something about gl stencil, but I haven't found a how to on this and I'm not familiar with opengl. Also I heard something about calling multiple times to the glScissor wo you can achieve a custom shape but

Problem glTexGen in Open GL ES 2.0

江枫思渺然 提交于 2019-12-24 01:01:43
问题 I have a problem somehow similar to this post : glTexGen in OpenGL ES 2.0 I've looked up on the web a couple of other websites without finding out how to solve my issue. Basically, I want to map a texture onto a 2D quad after having set up an orthographic projection. The problem I have is that the texture is distorted as you can see on this picture where I used a coloured pattern instead of a texture: I would like the lines of the texture to stay straight on the quad, but as you can see, they

How to discover if OpenGL ES frame rate is stuttering - without Instruments?

时光怂恿深爱的人放手 提交于 2019-12-24 00:56:19
问题 A friend just asked me this interesting question and I had no answer to this. He's making a game and sometimes he experiences lags in the frame rate. As if 10 or more frames get dropped. The run loop function is called by CADisplayLink. Is there a way to tell programmatically if frame rate was lagging? I'd just measure the time in the run loop function and then check if it's bigger than supposed to be. And if it is, remember that there was a lag. Could be useful to test on various devices on

Drawing text as textures on squares does not show anything

本小妞迷上赌 提交于 2019-12-24 00:04:12
问题 I'm new to OpenGL and I'm developing an Augmented-reality application for Android. Until now, I was drawing white squares, perpendicular to the camera, pointing the user to the direction where a "Point of interest" would be. Now, I'm trying to show some text into the squares. I've read a lot and it seems that creating a texture with the text is the most direct and easiest approach, so I'm creating the textures as soon as I get data of the Points of interest and stick them to their squares.