Grayscale rendering in MDX (Fixed function)By Rim van Wersch, January 9 2006 |
// set up texture states if (grayscale) { ? ?device.TextureState[0].ColorOperation = TextureOperation.DotProduct3; ? ?device.TextureState[0].ColorArgument1 = TextureArgument.TextureColor; ? ?device.TextureState[0].ColorArgument2 = TextureArgument.TFactor; ? ?// this will make out DotProduct3 operation output the luminance as the final color, see discussion for details ? ?device.RenderState.TextureFactor = ( 0xFF << 24 ) | ( (255-76) << 16) | ( (255-150) << 8) |(255- 29); } // render as normal
Further reading
-
?