Figured out how texture stages work, thanks to this:
authorSam Lantinga <slouken@libsdl.org>
Mon, 28 Aug 2006 04:39:37 +0000
changeset 19881ee02169bbb0
parent 1987 36a08379b3f2
child 1989 5b5f5de5433f
Figured out how texture stages work, thanks to this:
http://www.toymaker.info/Games/html/texture_states.html
Both color and alpha source modulation work now! :)
src/video/win32/SDL_d3drender.c
     1.1 --- a/src/video/win32/SDL_d3drender.c	Mon Aug 28 04:03:32 2006 +0000
     1.2 +++ b/src/video/win32/SDL_d3drender.c	Mon Aug 28 04:39:37 2006 +0000
     1.3 @@ -382,9 +382,24 @@
     1.4      IDirect3DDevice9_SetVertexShader(data->device, NULL);
     1.5      IDirect3DDevice9_SetFVF(data->device,
     1.6                              D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1);
     1.7 +    IDirect3DDevice9_SetRenderState(data->device, D3DRS_ZENABLE, D3DZB_FALSE);
     1.8      IDirect3DDevice9_SetRenderState(data->device, D3DRS_CULLMODE,
     1.9                                      D3DCULL_NONE);
    1.10      IDirect3DDevice9_SetRenderState(data->device, D3DRS_LIGHTING, FALSE);
    1.11 +    /* Enable color modulation by diffuse color */
    1.12 +    IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLOROP,
    1.13 +                                          D3DTOP_MODULATE);
    1.14 +    IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLORARG1,
    1.15 +                                          D3DTA_TEXTURE);
    1.16 +    IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLORARG2,
    1.17 +                                          D3DTA_DIFFUSE);
    1.18 +    /* Enable alpha modulation by diffuse alpha */
    1.19 +    IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAOP,
    1.20 +                                          D3DTOP_MODULATE);
    1.21 +    IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAARG1,
    1.22 +                                          D3DTA_TEXTURE);
    1.23 +    IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAARG2,
    1.24 +                                          D3DTA_DIFFUSE);
    1.25  
    1.26      return renderer;
    1.27  }