Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

In my current task, i need to render a texture into a render buffer, in order to work on it (apply special filters) there. The result is then considered a "new texture", which is later displayed.

This works fine, except when the texture contains some transparent/semi-transparent parts.

My current guess it that, within the render buffer, the texture is "merged" with a kind of "grey background". In this case, it obviously impacts the R,G,B color components of transparent pixels. I've yet to find a way around this.

Even manually assigning alpha after the rendering process doesn't save the day for semi-transparent pixels, which RGB are "tainted" by the grey background.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

It sounds like something is wrong with your blend modes or shaders. When you initially copy the texture to the render target, you should disable blending, which will just copy all the RGBA components to the render target without modification. Then, any filters you apply will need to handle alpha appropriately, whatever that may mean for the specific filter.

share|improve this answer
    
Actually, i need some of these textures to be stretched and/or bilinear filtered.... –  Cyan Dec 1 '12 at 1:21
    
@Cyan That's fine. That doesn't have any effect on blending. Bilinear filtering != blending. –  Nathan Reed Dec 1 '12 at 1:30
    
it worked perfectly ! Thanks ! –  Cyan Dec 1 '12 at 11:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.