   How to fill a texture with an opacity gradient?
  I want my texture to have an opacity gradient. What is the best way to do this?The docs have an example (below). Would anyone recommend it or are there more performant techniques? A linear gradient is all I need.LPDIRECT3DTEXTURE9 m_pTexture;// Create an alpha textureD3DXCreateTexture(m_d3dDevice, 128, 128, 0, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &m_pTexture);// Initialize the alpha channelint  yGrad, xGrad;D3DLOCKED_RECT lockedRect;if(SUCCEEDED(pTexture->LockRect(0, &lockedRect, NULL, D3DLOCK_DISCARD )){m_pRGBAData = new DWORD[128*128];if( m_pRGBAData != NULL ){for( DWORD y=0; y < m_dwHeight; y++ ){DWORD dwOffset = y*m_dwWidth;yGrad = (int)(((float)y/(float)m_dwWidth) * 255.0f);for( DWORD x=0; x < m_dwWidth; x ){xGrad = (int)(((float)x/(float)m_dwWidth) * 255.0f);DWORD b = (DWORD)(xGrad + (255 - yGrad))/2 & 0xFF;DWORD g = (DWORD)((255 - xGrad) + yGrad)/2 & 0xFF;DWORD r = (DWORD)(xGrad + yGrad)/2 & 0xFF;DWORD a = (DWORD)(xGrad + yGrad)/2 & 0xFF;lockedRect.pBits[dwOffset+x] = ((a<<24L)+(r<<16L)+(g<<8L)+(b));x++;}pTexture->UnlockRect(&lockedRect);}}}   