render-to-texture

Framebuffer FBO render to texture is very slow, using OpenGL ES 2.0 on Android, why?

不问归期 提交于 2019-11-28 19:56:28
I am programming an Android 2d game using opengl es 2.0. After I draw my sprites to the backbuffer I draw lights to a FBO and try to blend it to the back buffer again. When I draw the FBO to the framebuffer, even trasparent without any color, the framerates drops from 60 to 30 on a Samsung Galaxy w (it has an adreno 205 as gpu). I searched everywhere and tried everything, even if I draw a single sprite on the scene and blend a trasparent FBO texture to the screen the framerate drops. I tried other games with lighting effects on that phone and they run fine, almost every game is fine on that

opengl - blending with previous contents of framebuffer

不想你离开。 提交于 2019-11-28 16:54:23
I am rendering to a texture through a framebuffer object, and when I draw transparent primitives, the primitives are blended properly with other primitives drawn in that single draw step, but they are not blended properly with the previous contents of the framebuffer. Is there a way to properly blend the contents of the texture with the new data coming in? EDIT: More information requsted, I will attempt to explain more clearly; The blendmode I am using is GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA. (I believe that is typically the standard blendmode) I am creating an application that tracks mouse

Opengl Render To Texture With Partial Transparancy (Translucency) And Then Rendering That To The Screen

孤街醉人 提交于 2019-11-28 08:41:35
I've found a few places where this has been asked, but I've not yet found a good answer. The problem: I want to render to texture, and then I want to draw that rendered texture to the screen IDENTICALLY to how It would appear if I skipped the render to texture step and were just directly rendering to the screen. I am currently using a blend mode glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA). I have glBlendFuncSeparate to play around with as well. I want to be able to render partially transparent overlapping items to this texture. I know the blend function is currently messing up the RGB

ffmpeg video to opengl texture

雨燕双飞 提交于 2019-11-28 03:15:47
I'm trying to render frames grabbed and converted from a video using ffmpeg to an OpenGL texture to be put on a quad. I've pretty much exhausted google and not found an answer, well I've found answers but none of them seem to have worked. Basically, I am using avcodec_decode_video2() to decode the frame and then sws_scale() to convert the frame to RGB and then glTexSubImage2D() to create an openGL texture from it but can't seem to get anything to work. I've made sure the "destination" AVFrame has power of 2 dimensions in the SWS Context setup. Here is my code: SwsContext *img_convert_ctx = sws

Rendering to texture on iOS OpenGL ES—works on simulator, but not on device

家住魔仙堡 提交于 2019-11-28 00:29:24
问题 In order to improve the performance of my OpenGL ES application for the iPad, I was planning to draw a rarely updated but rendertime-heavy element to a texture, so I can just use the texture unless the element has to be redrawn. However, while the texture is mapped correctly on both the simulator and the device, only on the simulator is something actually rendered into the texture. The following is the code that I added to the project. While setting up the scene, I create the buffers and the

Framebuffer FBO render to texture is very slow, using OpenGL ES 2.0 on Android, why?

空扰寡人 提交于 2019-11-27 20:36:40
问题 I am programming an Android 2d game using opengl es 2.0. After I draw my sprites to the backbuffer I draw lights to a FBO and try to blend it to the back buffer again. When I draw the FBO to the framebuffer, even trasparent without any color, the framerates drops from 60 to 30 on a Samsung Galaxy w (it has an adreno 205 as gpu). I searched everywhere and tried everything, even if I draw a single sprite on the scene and blend a trasparent FBO texture to the screen the framerate drops. I tried

OpenGL ES Render to Texture

元气小坏坏 提交于 2019-11-27 16:53:53
I have been having trouble finding straightforward code to render a scene to a texture in OpenGL ES (specifically for the iPhone, if that matters). I am interested in knowing the following: How do you render a scene to a texture in OpenGL ES? What parameters must you use to create a texture that is capable of being a render target in OpenGL ES? Are there any implications with applying this rendered texture to other primitives? This is how I'm doing it. I define a texture variable (I use Apple's Texture2D class, but you can use an OpenGL texture id if you want), and a frame buffer: Texture2d *

opengl - blending with previous contents of framebuffer

邮差的信 提交于 2019-11-27 10:02:23
问题 I am rendering to a texture through a framebuffer object, and when I draw transparent primitives, the primitives are blended properly with other primitives drawn in that single draw step, but they are not blended properly with the previous contents of the framebuffer. Is there a way to properly blend the contents of the texture with the new data coming in? EDIT: More information requsted, I will attempt to explain more clearly; The blendmode I am using is GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA.

ffmpeg video to opengl texture

ⅰ亾dé卋堺 提交于 2019-11-27 05:04:34
问题 I'm trying to render frames grabbed and converted from a video using ffmpeg to an OpenGL texture to be put on a quad. I've pretty much exhausted google and not found an answer, well I've found answers but none of them seem to have worked. Basically, I am using avcodec_decode_video2() to decode the frame and then sws_scale() to convert the frame to RGB and then glTexSubImage2D() to create an openGL texture from it but can't seem to get anything to work. I've made sure the "destination" AVFrame

Opengl Render To Texture With Partial Transparancy (Translucency) And Then Rendering That To The Screen

强颜欢笑 提交于 2019-11-27 02:22:21
问题 I've found a few places where this has been asked, but I've not yet found a good answer. The problem: I want to render to texture, and then I want to draw that rendered texture to the screen IDENTICALLY to how It would appear if I skipped the render to texture step and were just directly rendering to the screen. I am currently using a blend mode glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA). I have glBlendFuncSeparate to play around with as well. I want to be able to render partially