Color Inverting in D3D
Does anyone know if/how to invert colors in D3D? I would tend to think there''s some obscure renderstate somewhere to set, but I''m not quite sure. By "invert" I mean changing black to white, red to teal, green to purple, and so forth.
You can use the D3DTA_COMPLEMENT modifier in your SetTextureStageState() setup to invert what''s being rendered during multitexture blending.
You could alternatively use frame buffer (alpha) blending with the INV***COLOR blending factors to achieve a number of inverse effects. For example if you wanted to invert the contents of what was already in the frame buffer you could render a white quad to those portions with a blend like INVDESTCOLOR:ZERO or INVDESTCOLOR:INVSRCCOLOR to achieve the inversion *.
It can of course also be achieved with pixel shaders instead of the texture stage state setup.
[*]<br><br>–<br>Simon O''Connor<br>3D Game Programmer &<br><a href="http://mvp.support.microsoft.com/">Microsoft DirectX MVP</a><br>
You could alternatively use frame buffer (alpha) blending with the INV***COLOR blending factors to achieve a number of inverse effects. For example if you wanted to invert the contents of what was already in the frame buffer you could render a white quad to those portions with a blend like INVDESTCOLOR:ZERO or INVDESTCOLOR:INVSRCCOLOR to achieve the inversion *.
It can of course also be achieved with pixel shaders instead of the texture stage state setup.
[*]<br><br>–<br>Simon O''Connor<br>3D Game Programmer &<br><a href="http://mvp.support.microsoft.com/">Microsoft DirectX MVP</a><br>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement