Transperancy for n00bs

BlitzPlus Forums/BlitzPlus Programming/Transperancy for n00bs

bloos_magoos(Posted 2013) [#1]
Is there a way for blitz plus to detect transperancy like right in the image? I want to do several glow effects and a vignette effect in photoshop, and it doesn't really work because blitzplus can't detect transperancy unless you use a color to mask it, which also won't work because the glow makes the rgb values not good.

So long story short, can somebody help me make blitz set the maskimage to transperant, or possibly provide me some code that can make images glow?


Yasha(Posted 2013) [#2]
Not easily.

BlitzPlus's built-in 2D engine is very, very basic and only supports flat blits and pixel operations. There's no support whatsoever for any kind of advanced blending operations, as the whole thing is software-based.

You can write your own low-level drawing function using WritePixelFast, and obviously this can do whatever you want including respecting alpha values, but this will be very slow (you can't really do this efficiently in software, which is why the built-in system doesn't try). Still, it will work well enough if you don't need realtime performance. You should be able to find some examples of this in the Code Archives or Toolbox (links at the top).


The only way to get proper transparency and other such effects is with 3D hardware acceleration. You can get a hardware-accelerated 2D drawing engine as part of the bOGL library (see the link in my signature). It's ludicrously fast but of course uses a slightly different command set; so if you use this, you will no longer be using the core BlitzPlus graphics system (it doesn't cost money or anything but not many people will be able to give useful advice about it, and its documentation is separate from, and unrelated to, the BP help files). bOGL also supports additive blending, which is more useful than transparency for most glow-type effects.