BlitzMax... Here is a small demo I knocked up for someone who wanted to know how to do grayscale textures. These textures are converted by the GPU on the fly, there is no overhead.
Example with Render2Texture : http://indiepath.com/public/Example2.rar (HIT MOUSE BUTTON TO RANDOMISE THE dwFactor).
Here is the code for you DirectX type people :
Example with Render2Texture : http://indiepath.com/public/Example2.rar (HIT MOUSE BUTTON TO RANDOMISE THE dwFactor).
Here is the code for you DirectX type people :
Function SetMono(dwFactor:Int = $FFFF0000) PrimaryDevice.device.SetRenderState(D3DRS_TEXTUREFACTOR, dwFactor) PrimaryDevice.device.SetTextureStageState(0, D3DTSS_COLOROP,D3DTOP_DOTPRODUCT3) PrimaryDevice.device.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE) PrimaryDevice.device.SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TFACTOR) End Function Function UnsetMono() PrimaryDevice.device.SetRenderState(D3DRS_TEXTUREFACTOR, $FFFFFFFF ) PrimaryDevice.device.SetTextureStageState(0, D3DTSS_COLOROP,D3DTOP_MODULATE) PrimaryDevice.device.SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE) PrimaryDevice.device.SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_DIFFUSE) End Function