opengl-es

Ping-pong rendering between two FBOs fails after first frame.

戏子无情 提交于 2019-12-07 09:32:16
问题 I am trying to create two FBOs and implement a ping-pong render. But, I only get the first frame to work properly. I am trying to simulate a game-of-life and, after the first frame, I only get a black screen. Could you help me check it? I have spent hours on this issue. Edit Maybe I didn't describe clearly. Actually, I want to use the textureB as the texture and render it to textureA, then use the textureA to render to screen, then vice versa. Edit I can see the first frame, which is the

How to reduce draw calls in OpenGL/WebGL

匆匆过客 提交于 2019-12-07 09:22:57
问题 When i read about performance in OpenGL/WebGL, i almost hear about reducing the draw calls. So my problem is that i am using only 4 vertices to draw a textured quad. This means generally my vbo contains only 4 vertices. Basically gl.bindBuffer(gl.ARRAY_BUFFER,vbo); gl.uniformMatrix4fv(matrixLocation, false, modelMatrix); gl.drawArrays(gl.TRIANGLE_FAN,0, vertices.length/3); And here comes the problem i see. Before drawing i update the modelmatrix of the current quad. For example to move it 5

Could you recreate the 3D page turning effect seen in the iBooks app using only Core Animation or would you need to use OpenGL ES?

柔情痞子 提交于 2019-12-07 08:55:26
问题 I read an article somewhere explaining that apple uses OpenGL ES to implement the page turning effect in the iBooks app. Since you can perform 3D animations on 2D Layers using only Core Animation, what might be some reasons you'd have to use OpenGL ES to create that page transition animation? Thanks in advance for your thoughts! 回答1: Steven Troughton-Smith has accomplished this here without OpenGL. http://blog.steventroughtonsmith.com/2010/02/apples-ibooks-dynamic-page-curl.html However, he

Open GL Bad Config Error on Samsung S4

我是研究僧i 提交于 2019-12-07 08:34:15
问题 I am getting the following error on Samsung S4 10-21 16:25:44.100: E/AndroidRuntime(29778): FATAL EXCEPTION: GLThread 11320 10-21 16:25:44.100: E/AndroidRuntime(29778): Process: <bundle ID>, PID: 29778 10-21 16:25:44.100: E/AndroidRuntime(29778): java.lang.RuntimeException: createContext failed: EGL_BAD_CONFIG 10-21 16:25:44.100: E/AndroidRuntime(29778): at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1201) 10-21 16:25:44.100: E/AndroidRuntime(29778): at android

gl_PointSize to screen coordinates

≯℡__Kan透↙ 提交于 2019-12-07 08:17:00
问题 When I calculate the gl_PointSize the same way I do it in the vertex shader I get a value "in pixels" (according to http://www.opengl.org/sdk/docs/manglsl/xhtml/gl_PointSize.xml). Yet this value doesn't match the measured width and height of the point on the screen. The difference between the calculated and measured size is no constant it seems. Calculated values range from 1 (very far away) to 4 (very near) Current code (with three.js, but nothing magic), trying to calculate the size of a

Difference between glkView:drawInRect: and glkViewControllerUpdate:? OpenGL ES 2 - iOS

≡放荡痞女 提交于 2019-12-07 07:51:27
问题 What should be the difference, purpose wise, between these two methods in my render loop? Apple has this to say.... About update() The view controller calls its delegate’s glkViewControllerUpdate: method. Your delegate should update frame data that does not involve rendering the results to the screen. About drawInRect: the GLKView object makes its OpenGL ES context the current context and binds its framebuffer as the target for OpenGL ES rendering commands. Your delegate method should then

Mapping a square texture to a triangle

二次信任 提交于 2019-12-07 07:31:16
I started to play with a OpenGL ES 1.0 and I run into some (beginners) problem: I tried to map a square texture to the cube described by triangles. // Turn necessary features on glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_SRC_COLOR); glEnable(GL_CULL_FACE); //glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Bind the number of textures we need, in this case one. glGenTextures(1, &texture[0]); glBindTexture(GL_TEXTURE_2D, texture[0]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

Render text in purely native Android app [closed]

老子叫甜甜 提交于 2019-12-07 07:20:43
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I have a purely native Android NDK app, and need to render some text at every frame. I have read posts saying that I need to create a single image file with all the characters of my font, and then render each character as a quad from this image. This sounds like a lot of work and

Ambigious OpenGL Default Camera position

风格不统一 提交于 2019-12-07 06:58:58
问题 in my Opengl programs (before i apply perspective projection matrix) whenever i draw some object I draw it at the origin of the world coordinate system, however almost all of the Opengl tutorials states that the camera (My projection view) is located at the origin looking toward positive z-axis (which depends on how you treat z value in the projection matrix later on), however if that is true how does my camera (located in the origin) is able to view an object located in the origin. Note: i

GLSL integration function

可紊 提交于 2019-12-07 06:36:24
问题 Any recommendation on how to implement efficient integral functions, like SumX and SumY, in GLSL shaders? SumX(u) = Integration with respect to x = I(u0,y) + I(u1,y) +... + I(uN,y); u=normalized x coordinate SumY(v) = Integration with respect to y = I(x,v0) + I(x,v1) +... + I(x,vN); v=normalized y coordinate For instance the 5th pixel of the first line would be the sum of all five pixels on the first line. And the last pixel would be the sum of all previous pixels including the last pixel