BRL.Max2D - INVERTBLEND
BlitzMax Forums/BlitzMax Module Tweaks/BRL.Max2D - INVERTBLEND
| ||
This blend invert pixel color value. ( negative image ) driver.bmx ( BRL.max2D ) ------------- At line 13, insert lines : Const INVERTBLEND=6d3d7max2D.bmx ( BRL.d3d7max2D ) ------------- At line 243, insert lines : Case INVERTBLEND device.SetRenderState D3DRS_ALPHATESTENABLE,False device.SetRenderState D3DRS_ALPHABLENDENABLE,True device.SetRenderState D3DRS_SRCBLEND,D3DBLEND_INVDESTCOLOR device.SetRenderState D3DRS_DESTBLEND,D3DBLEND_ZEROglmax2D.bmx ( BRL.Glmax2D ) ------------- At line 299, insert lines : Case INVERTBLEND glEnable GL_BLEND glBlendFunc GL_ONE_MINUS_DST_COLOR, GL_ZERO glDisable GL_ALPHA_TEST |
| ||
Nice, Mark - Stick it in the official mods please. |
| ||
Yep, I second this, if it is well compatible! |
| ||
Would be a nice addition -- the more blend modes, the better. |
| ||
You guys rock. |
| ||
Nice one! Cool blend ;) I made a minor change, hope you don't mind: glBlendFunc GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR so the inversion is gradual (black doesn't invert, white inverts 100%), I think it may be good for some distortion fx! for dx version (I'm not sure, haven't tested) the change would be something like... device.SetRenderState D3DRS_SRCBLEND,D3DBLEND_INVDESTCOLOR device.SetRenderState D3DRS_DESTBLEND,D3DBLEND_INVSRCCOLOR (well in fact, I made a new blend; I think both of them are useful) |
| ||
At start,I wanted to invert source image color without using pixmap pixel pointer. |