PDA

View Full Version : Render-to-texture with blending?



Laif
05-19-2005, 02:04 AM
Hi,

I'm using RenderTexture (http://sourceforge.net/project/showfiles.php?group_id=104004&package_id=115053) to render my scene to a texture.

It works well, however blending doesn't work correctly. Is there anything special I have to consider when using render-to-texture with blending?

Ehsan Kamrani
05-19-2005, 02:37 AM
Have you used from the GL_RGB rather than the GL_RGBA symbolic constant?
if you want to load an *RGBA* image into the textureData that has a width and height of textureWidth and textureHeight, you can use from the following code:
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, texturewidth, textureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureData );
For more information, See lesson 8 of the NeHe lessons.
-Ehsan-

05-19-2005, 10:09 AM
Originally posted by Laif:
Is there anything special I have to consider when using render-to-texture with blending?Your description is somewhat vague and "it dosnt work correctly" could also mean that it simly doesnt work the way you expect it to work which isnt necessarily incorrect, if you get my drift.

Can you provide some more details? For example what pixelformat you use for the pbuffer?

There are certain restrictions when you use floating point pbuffers. To be precise, AFAIK only Nvidia Geforce6 (NV4x) class hardware can do floating point blending and even those can do it only on half floats (dont know about the 3dlabs Wildcats tho).

I do hope that ATIs R520 will be able to do full floating point blending, we shall see.