Is it possible to have a surface blend with another surface using blit effects like Overlay and Screen? I know you can blend a color over a surface using blit effects, but I want to use another surface instead of a color. The Photoshop equivalent would be to set the layer's blending mode so that it will blend with whatever layers are behind it. Is this possible in GapiDraw?
blending with blit effects
Any chance of see something like this for the final version of 3.5? This is a big deciding factor for me on whether to start using GapiDraw for my next major versions of my software. Thanks!
It probably won't be in 3.5, but we might add "Pixel Shaders" in 4.0 with a function call on each pixel to your own custom blit effect. I'll give it a look, and if it's not TOO much work I might be able to squeeze it into 3.5.
Johan wrote:we might add "Pixel Shaders" in 4.0 with a function call on each pixel
That sounds slow unless you are going to expose your internal template functions.
Yep, it will be really slow. So that's why I'm not sure I'll add it. PocketFrog has it and lots of people during the past two years have raved about it, so I guess that it's ok for some uses.
Adding support for "two surfaces in" -> "one surface out" requires a whole new BltFast operation, and will probably not surface until GapiDraw 4.0.
Adding support for "two surfaces in" -> "one surface out" requires a whole new BltFast operation, and will probably not surface until GapiDraw 4.0.
For perf, you could do something between the current Blt effects and pixel-shader callbacks using GDI ROP3 codes on steroids. Come up with a very short branching pipeline that can be described by a short structure and which is processed by the Blt function for each pixel.
At the extreme end of things this turns into passing compiled code into the Blt core like real pixel shaders, but that would be overkill. But coming up with a subset (like ROP codes, but more than one stage) might be possible.
(Of course, then the next step is to get fancy and either dynamically recompile the function when it isused or statically compile the branches in using templates. But that is just silly. Someone who can write a pixel shader can probably write their own Blt function.)
At the extreme end of things this turns into passing compiled code into the Blt core like real pixel shaders, but that would be overkill. But coming up with a subset (like ROP codes, but more than one stage) might be possible.
(Of course, then the next step is to get fancy and either dynamically recompile the function when it isused or statically compile the branches in using templates. But that is just silly. Someone who can write a pixel shader can probably write their own Blt function.)
Actually, a pixel shader would do the job! Speed is really not an issue for my purposes, so that would be great if that could be squeezed in.
Would I be able to use this with Blt or only BltFast? I'd want to use a pixel shader on a transformed image too.
Would I be able to use this with Blt or only BltFast? I'd want to use a pixel shader on a transformed image too.