Copy RGBA pixels directly to target texture without blending |
stewambo
|
Hello,
I have a texture with static (or streaming) access and I need to render other stuff onto it, so I need to convert it to a target-texture. Therefor I just created an empty texture with SDL_TEXTUREACCESS_TARGET and set it as rendering target, but when i render my semi-transparent static/streaming texture onto it the black transparent background of the target-texture bleeds into the transparent part of my original texture Original image: Left: original texture rendered directly; Right: target-texture with original texture rendered ontop (obviously not the same, but darker) Code to create the image above:
The solution to my problem in this topic was to set the background color of the target texture to one solid color, but here this doesn't work because the static texture is not a solid color... So how can i get my target-texture to look exactly like my original texture, or is there a way to copy the RGBA information directly into the new texture without the need to render it using a blend mode? Thanks |
|||||||||||||
|
stewambo
|
Thanks to rtrussell (this thread) I tried the SDL_BLENDMODE_NONE again and found my mistake. Previously I always set the SDL_BLENDMODE_NONE for the target texture I wanted to render to, but I needed to set it for the static/streaming texture. Now it works perfectly fine.
|
|||||||||||
|