Substract texture blend?

Blitz3D Forums/Blitz3D Programming/Substract texture blend?

Braincell(Posted 2006) [#1]
Is there a way to have a texture on substract mode? Like add blend mode only the opposite, where black parts of the texture are substracted?

I'm working on the stencil shadow system and i looked into shaders at the same time (just for fun) and i found that there is a way to make soft stencil shadows by rendering the stencils to a colour buffer as black where the shadows should be, rendering this to a quad, blurring it, putting the quad infront of the camera and then putting it on substract. The shaders i looked at are considerably different tho, but they gave me this idea anyway. Everything's done differently in blitz :P A substract mode is really desireble because if i use plain alpha with colour for the quad, the level colours will be desaturated (grayed out) because of the gray empty areas, which would be white if used with substract mode so they wouldnt affect the scene. Having a quad with an alpha map isn't really feasable i think (or it is but could be slowWwWwW).

Thoughts?

PS. yea ok i'll have less fun and do more real work on the system :P


Shifty Geezer(Posted 2006) [#2]
You can use multiply mode. A black pixel is rendered black, a white pixel changes nothing, and grey pixels produce various shaders in between. There is no subtraction blend so if you can do what you want with multiply (unlikely) than you'll have to manual write to the textures.