The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Sutractive Blending
BadManiac


Joined: 07 Aug 2014
Posts: 7
I have a scenario in which I need subtractive blending, and from what I can tell reading th edocumentation SDL only supports source alpha, additive and multiplicative blending. Is there a way to get subtractive alpha?

Basically I need dstRGB = dstRGB - (srcRGB * srcA). Is this currently possible in SDL? And if not, is there a work around to make it happen?
How to do Subtractive Beldning in SDL 2?
BadManiac


Joined: 07 Aug 2014
Posts: 7
More than 750 views and no answers? Clearly quite a few people are interested in this, so has anyone done it?
Naith


Joined: 03 Jul 2014
Posts: 158
Here are the blend modes that SDL2 has / supports: https://wiki.libsdl.org/SDL_BlendMode
Re: How to do Subtractive Beldning in SDL 2?
mr_tawan


Joined: 13 Jan 2014
Posts: 161
BadManiac wrote:
More than 750 views and no answers? Clearly quite a few people are interested in this, so has anyone done it?


I think many people expecting that you're proposing new feature with a patch included :-).

Anyway I think there is no support for that blend mode currently. You might have to implement yourself (with the backend that you're using, eg. OpenGL).
Sutractive Blending
Mason Wheeler
Guest

Just be careful. A while back I tried doing exactly that. The response I got: Implement it for all renderers and we'll look at putting it in. As if I'm supposed to know how to do that for other renderers I've never worked with. (Not to mention in software!)




On Thursday, August 21, 2014 3:14 AM, mr_tawan wrote:










BadManiac wrote: More than 750 views and no answers? Clearly quite a few people are interested in this, so has anyone done it?


I think many people expecting that you're proposing new feature with a patch included .

Anyway I think there is no support for that blend mode currently. You might have to implement yourself (with the backend that you're using, eg. OpenGL).



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Sutractive Blending
Jonny D


Joined: 12 Sep 2009
Posts: 932
If there's a bug report for this, then others can contribute patches for each renderer separately.

Jonny D





On Thu, Aug 21, 2014 at 2:55 PM, Mason Wheeler wrote:
Quote:
Just be careful.  A while back I tried doing exactly that.  The response I got: Implement it for all renderers and we'll look at putting it in.  As if I'm supposed to know how to do that for other renderers I've never worked with.  (Not to mention in software!)




On Thursday, August 21, 2014 3:14 AM, mr_tawan wrote:












BadManiac wrote: More than 750 views and no answers? Clearly quite a few people are interested in this, so has anyone done it?


I think many people expecting that you're proposing new feature with a patch included .

Anyway I think there is no support for that blend mode currently. You might have to implement yourself (with the backend that you're using, eg. OpenGL).





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org









_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org