writing to all 4 channels without the Alpha affecting the RGB

Started by
1 comment, last by Wilhelm van Huyssteen 10 years, 3 months ago

Hi.

Im trying to optimize my crude rendering pipeline a bit. I have a couple of offscreen textures that I render to using FBO's (and multiple render targets). Until now they've all been 3 channel textures. Now i want to use 4 channel textures so i can store more in a texture and use less textures overall. But even if i disable blending the RGB values still gets multiplied by the alpha when I render to a 4 channel texture. How do I prevent this from happening? I want the RGBA values that got set as output in the fragment shader to be written to the texture as is with no further calculation.

Thnx in Advance!

Advertisement

With alpha blending disabled, the value your shader writes out should be the value that ends up in your render-to-texture target. You might want to double check alpha blending really is disabled and that your pixel shader isn't doing the multiply.

Another possibility is that perhaps your code is correct when you're doing the bit when the RTT is the render target, but you have alpha blending enabled when you're rendering using the RTT as the texture source. That would result in similar symptoms.

Yes in the end it was just the fact that blending wasnt disabled at all the places where it should have been disabled. Thought there was a more interesting reason why it would do that ^^

Thnx

This topic is closed to new replies.

Advertisement