opengl-es-2.0

OES_texture_float extension use

你说的曾经没有我的故事 提交于 2019-12-11 21:15:34
问题 How to use the OES_texture_float extension? I do not understand that it is necessary to specify the arguments the function texImage2D. var fb=gl.createFramebuffer(); gl.bindFramebuffer(gl.FRAMEBUFFER, fb); var rb=gl.createRenderbuffer(); gl.bindRenderbuffer(gl.RENDERBUFFER, rb); gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16,size[0],size[1]); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER, rb); var texture=gl.createTexture(); gl.bindTexture(gl

Drawing animated circle with OpenGL ES 2.0

陌路散爱 提交于 2019-12-11 20:00:36
问题 I have a circle object, created with OpenGL vertices. When the circle is being touched, I want a scaling animation to be activated. The circle radius will grow bigger until it reaches a certain radius, and then the circle will transform back to its original radius. What is the best way to implement this animation? 回答1: You have a few possibilities. The simplest would be to just create a variable which would hold a scaling factor for your circle and multiply all vertices by it before rendering

Opengl es: Render to Texture via Frame Buffer is rendering only one color

爱⌒轻易说出口 提交于 2019-12-11 18:37:14
问题 am trying to implement a motion blur effect in my android game. After a lot of research I found that the best way to do that is to save the previous frame as a texture using the Frame Buffer Object and render it on top of the current frame. So seeing some nice tutorials on how to do something like that I ended up with this code which basically render my scene on the texture and then draws the texture to the default framebuffer. But the texture has only one color ,like when i have a green

Why is it necessary to bind a buffer more than once in succession? [duplicate]

笑着哭i 提交于 2019-12-11 18:27:01
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: How does glBufferData know which VBO to work on? I've noticed in sample code (in an O'Reilly book) for both VBOs and render buffers that the binding is done more than once. What is the reasoning behind this? For example, you might have this at the top of an OpenGL routine: glGenBuffers(1, &m_vertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer); And then before doing the drawing, you do it again:

Could a vertex shader be used for a page turn effect?

巧了我就是萌 提交于 2019-12-11 18:15:33
问题 I've done Open GL ES in the past, but quite a while ago. From what I'm reading now, it seems there is a lot more emphasis on managing your own matrix stacks and pushing your matrices directly into a vertex shader to position your objects. This is all well and good, but I'm just wondering how far you're meant to go with shaders. I don't know if they are only for simple things, or can I use them for a page turn effect. There will definitely be a lot of math that needs to be calculated. It feels

Why is my list of objects all the same?

a 夏天 提交于 2019-12-11 18:14:42
问题 I've been making lists of objects for a while now to make multiple objects in the games I program. I haven't had an issue until now. I use a for loop to create 3 objects, give each object its own values, and then add them to the array list. Unfortunately, when I tried this each object had the same values, which I figured out through logs were the values of the last item in the list. I'm not sure what I'm doing wrong. Here is the code I'm using(I apologize. It's very sloppy, I'm just trying to

OpenGL ES 2.0: Commands required just before glDrawElements with VBO [closed]

喜夏-厌秋 提交于 2019-12-11 15:18:42
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I've setup a Vertex Buffer Object (VBO) with vertex and index data. I've also created a GLprogram to use custom shaders, so I call glUseProgram within my code. My vertex data changes every frame, so I've supplied

Correct vertex shader code? OpenGL ES 2.0

半城伤御伤魂 提交于 2019-12-11 14:07:43
问题 Edit Code added, please see below Edit 2 - Screenshots from device included at bottom along with explanation Edit 3 - New code added I have 2 classes, a rendered and a custom 'quad' class. I have these declared at class level in my renderer class: final float[] mMVPMatrix = new float[16]; final float[] mProjMatrix = new float[16]; final float[] mVMatrix = new float[16]; And in my onSurfaceChanged method I have: @Override public void onSurfaceChanged(GL10 gl, int width, int height) { GLES20

Is there something like XCode's OpenGL Frame Capture for MonoTouch?

纵饮孤独 提交于 2019-12-11 13:40:19
问题 XCode's 'Frame Capture' feature is here since XCode 4.2. Is there a similar feature in MonoTouch, or is it possible to leverage XCode's feature in a MonoTouch project? @Xamarin people: If not, are there any plans to support something like this? 来源: https://stackoverflow.com/questions/12223401/is-there-something-like-xcodes-opengl-frame-capture-for-monotouch

Load Uniform Matrix 1104 GL_Invalid_Operation Android OpenGLES 2.0

﹥>﹥吖頭↗ 提交于 2019-12-11 12:06:26
问题 I am working on implementing rendering to texture on Android 4.3+ (OpenGLES 2.0) I am getting the following error in my DrawFrame() method: 01-15 13:40:07.545: W/Adreno-ES20(23709): <__load_uniform_matrix:1104>: GL_INVALID_OPERATION 01-15 13:40:07.545: E/com.hpp.STextureRender(23709): glDrawArrays: glError 1282 01-15 13:40:07.545: D/io.hpp.CaptureManager(23709): Error encountered in drawFrame = glDrawArrays: glError 1282 01-15 13:40:07.545: W/System.err(23709): java.lang.RuntimeException: