   Second texturestage alpha value [RESOLVED]
  Hi,I'm new to multi texturing, so please bear with me. I have a reflection map on my second texture stage...m_pD3DDevice->SetTextureStageState( 1, D3DTSS_COLOROP,   D3DTOP_ADD );m_pD3DDevice->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE );m_pD3DDevice->SetTextureStageState( 1, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR );seems to work fine, except that I want to change the amound of 'reflectivity' so that I can vary the amount of the first stage texture I see by passing something like an alpha value to the second stage. How can I do this?[Edited by - darrenmarklines on August 11, 2006 12:18:49 PM]
  Use colorop MultiplyAdd (and arg0).  I can never remember if the documentation's arg3 = arg0, or if arg1=arg0, arg2=arg1, arg3=arg2.  Just reorder things until it works. ;)stage 0 color = diffuse texture * lightingstage 0 alpha = anythingstage 1 color = cubetex * tfactor + currentstage 1 alpha = anythingstage 2 color = stage 2 alpha = disableorUse D3DTOP_MODULATEALPHA_ADDCOLOR with your reflection as arg2, current as arg1, and have stage 0 setup the blend amount in stage 0's alpha.ie:stage 0 color = diffuse texture * lightingstage 0 alpha = tfactor (D3DRS_TEXTUREFACTOR to set)stage 1 color = (stage 0 color) + (stage 0 alpha) * (cubemap)stage 1 alpha = somethingstage 2 color = stage 2 alpha = disableThe multiplyadd may not be available on some older hardware, but it will allow a color tint on the reflection as it's using tfactor's RGB, not just alpha.All the math for all the modes is documented fairly clearly in the SDK.  Go to index, type D3DTEXTUREOP, and look at what's available.   ;  Thanks, setting the tfactor was what I wanted.m_pD3DDevice->SetTextureStageState( 1, D3DTSS_COLOROP,   D3DTOP_MULTIPLYADD );// EnvironmentShininess is a unsigned long specifying ARGB colourm_pD3DDevice->SetRenderState( D3DRS_TEXTUREFACTOR , m_EnvironmentShininess );m_pD3DDevice->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE );m_pD3DDevice->SetTextureStageState( 1, D3DTSS_COLORARG2, D3DTA_TFACTOR );