render-to-texture

Interpolating two textures by a third texture (factor is in lightness, not alpha)

How can I efficently interpolate per-pixel two textures A and B by a dynamic texture C and draw them on a simple quad? Multi-pass algorithms accepted. I've had moderate success calculating the C texture per-frame on the CPU and uploading it with glTexImage2D into an alpha-only texture. While this worked, performance was lacking and I h...

OpenGL ES Render to Texture

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 ...

Render to texture problem with alpha

When I render to texture, and then draw the same image, it seems to make everything darker. To get this image: I'm rendering the upper-left square with color (1, 1, 1, .8) to a texture, then rendering that texture, plus the middle square (same color) to another texture, then finally that texture plus the lower-right square (same color...

Image blending problem when rendering to texture

This is related to my last question. To get this image: I draw a white background (color = (1, 1, 1, 1)). I render-to-texture the two upper-left squares with color = (1, 0, 0, .8) and blend function (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), and then draw the texture with color = (1, 1, 1, 1) and blend function (GL_ONE, GL_ONE_MINUS_SRC...

OpenGL with FBO RTT, blending when it shouldn't

This should be really simple, but it's consumed multi-hours of my time, and I have no clue what's going on. I'm rendering a flat-colored full-screen quad to a texture, then reading back the result with glGetTexImage. It's GPGPU related, so I want the alpha value to behave as if it's any of the other three. I'm using an FBO, texture form...

Setting a texture in a pixel shader and making it the render target?

I was wondering, if I render a scene using a shader to which I pass in a texture that also happens to be the render target for that scene will it cause any unwanted behaviour? So basically: texture t; shader->SetTexture("texture",t); device->SetRenderTarget( 0, t->surface ); shader->Begin("effect") // do some more shader stuff devi...

OpenGL ES render to texture, then draw texture

I'm trying to render to a texture, then draw that texture to the screen using OpenGL ES on the iPhone. I'm using this question as a starting point, and doing the drawing in a subclass of Apple's demo EAGLView. Instance variables: GLuint textureFrameBuffer; Texture2D * texture; To initialize the frame buffer and texture, I'm doing th...

Android OpenGLES Render-to-Texture

Hey! I write graphics apps for the iPhone and I'm looking to port my most recent app, 'Layers,' to the Android platform. Layers is painting app that allows users to draw on the screen and create multi-layered paintings with different brushes, colors, etc... and export to PSD. It's got desktop sync, a smudge tool, lots of good stuff... ht...

Rendering OpenGL FBO Texture to GLXPixmap

I'm writing some code which is intended to: 1. Render into an OpenGL texture using an FBO. 2. Draw from the FBO texture to a GLXPixmap, which is attached to an X Pixmap. 3. Draw the X Pixmap to a window on the screen. Step 3 works great, and step 2 works fine if I replace the FBO texture with normal OpenGL drawing. But if I do what's a...

opengl - blending with previous contents of framebuffer

Hello, 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 w...

Alpha/texturing issues in an OpenGL wrapper

I'm in the process of writing a wrapper for some OpenGL functions. The goal is to wrap the context used by the game Neverwinter Nights, in order to apply post-processing shader effects. After learning OpenGL (this is my first attempt to use it) and much playing with DLLs and redirection, I have a somewhat working system. However, when ...

Render string to texture in Android and OpenGL ES

I've googled around everywhere, but cannot find much for rendering strings to textures and then displaying that texture on a quad on the screen. Can someone provide a run-down on the process or provide good resources that describe how? Is rendering strings to textures even the best method for displaying text in an Android OpenGL ES app? ...

Problem with JOGL and Framebuffer Render-to-texture: Invalid Framebuffer Operation Error

Okay, so I am trying to render a scene to a small 32x32 texture and ran into problems. I get an "invalid framebuffer operation" error when I try to actually draw anything to the texture. I have simplified the code below so that it simply tries to render a quad to a texture and then bind that quad as a texture for another quad that is ren...

Render to texture or offscreen framebuffer

I have a problem with rendering to texture and offscreen framebuffer with OpenGL ES on iPhone. First image shows mahjong tiles rendered to CAEAGLLayer directly and this is correct. Second one shows tiles rendered to offscreen framebuffer, copied to texture using glCopyTexImage2D and the texture rendered to CAEAGLLayer. Both use white ...

another question about OpenGL ES rendering to texture

Hello, pros and gurus! Here is another question about rendering to texture. The whole stuff is all about saving texture between passing image into different filters. Maybe all iPhone developers knows about Apple's sample code with OpenGL processing where they used GL filters(functions), but pass into them the same source image. I need ...

GLSL shader render to texture not saving alpha value

UPDATE: Danvil solved it in a comment below. My texture format was GL_RGB not GL_RGBA which of course means that the alpha values aren't kept. Don't know why I didn't realize... Thanks Danvil. I am rendering to a texture using a GLSL shader and then sending that texture as input to a second shader. For the first texture I am using RGB c...

Which parameter to pass to glGet for getting current framebuffer in OpenGLES iPhone.

I know to use glGet to get various parameters. I need to know how to get the current GL_FRAMEBUFFER_OES and get the GLuint type framebuffer id. I need to use renderToTexture. This will make one of the classes code easier when switching back to normal framebuffer. ...

glFramebufferTexture2D performance

I'm doing heavy computation using the GPU, which involves a lot of render-to-texture operations. It's an iterative computation, so there's a lot of rendering to a texture, then rendering that texture to another texture, then rendering the second texture back to the first texture and so on, passing the texture through a shader each time. ...

Advanced Text Rendering with Direct3D

Hello guys, Let me shortly describe the "battlefield" of my task: Multi-room audio/video chat with more than 1M users; Custom Direct3D renderer; What I need to implement is TextOverVideo feature. The Text itself goes via network and is to be rendered on the recipient side with Direct3D renderer. AFAIK, it is commonly used in game de...

Render to texture in different thread on iPhone

Hello! In my iPhone game I use separate thread to load resources. I use multiple EAGLContext's. Sometimes I need to render to texture in this background thread. But all I get is the black 1024*1024 texture. How do I render to texture in one thread while other thread is performing screen rendering? ...