Does anyone see a means to have an object render such that its colour is the inverse of the colour behind it, blended via transparency.
So, for a given pixel, the result should be something like this, I think:
finalColour = (1 - frameBufferColour)*incomingAlpha + frameBufferColour*frameBufferAlpha
Right now I’m using a ColorBlendAttrib set to subtract the frame-buffer colour from one. Something like this:
np.setAttrib(ColorBlendAttrib(ColorBlendAttrib.MSubtract, ColorBlendAttrib.OOne, ColorBlendAttrib.OOne)
And this works!
Save that it seems to lose all transparency above “0”. That is, regardless of alpha-values from texture or vertex-colour, there is no semi-transparent blending between the inverted-colour object and whatever is behind it.
If I simply remove the call to “setAttrib”, transparency resumes as expected, so it does seem to be a result of the blending-attrib.
And this makes sense! I have the object in question producing a result that doesn’t involve its alpha. But right now I don’t see a clear way of incorporating that alpha-value…
So, does anyone see a way of producing the effect that I’m looking for, while still retaining transparency…?
(Without using a shader, that is; I don’t want to make a shader specifically for this, ideally.)