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! :) --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402035
This commit is contained in:
parent
357dc8de4a
commit
d11e6208f1
1 changed files with 15 additions and 0 deletions
|
@ -382,9 +382,24 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||||
IDirect3DDevice9_SetVertexShader(data->device, NULL);
|
IDirect3DDevice9_SetVertexShader(data->device, NULL);
|
||||||
IDirect3DDevice9_SetFVF(data->device,
|
IDirect3DDevice9_SetFVF(data->device,
|
||||||
D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1);
|
D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1);
|
||||||
|
IDirect3DDevice9_SetRenderState(data->device, D3DRS_ZENABLE, D3DZB_FALSE);
|
||||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_CULLMODE,
|
IDirect3DDevice9_SetRenderState(data->device, D3DRS_CULLMODE,
|
||||||
D3DCULL_NONE);
|
D3DCULL_NONE);
|
||||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_LIGHTING, FALSE);
|
IDirect3DDevice9_SetRenderState(data->device, D3DRS_LIGHTING, FALSE);
|
||||||
|
/* Enable color modulation by diffuse color */
|
||||||
|
IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLOROP,
|
||||||
|
D3DTOP_MODULATE);
|
||||||
|
IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLORARG1,
|
||||||
|
D3DTA_TEXTURE);
|
||||||
|
IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLORARG2,
|
||||||
|
D3DTA_DIFFUSE);
|
||||||
|
/* Enable alpha modulation by diffuse alpha */
|
||||||
|
IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAOP,
|
||||||
|
D3DTOP_MODULATE);
|
||||||
|
IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAARG1,
|
||||||
|
D3DTA_TEXTURE);
|
||||||
|
IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAARG2,
|
||||||
|
D3DTA_DIFFUSE);
|
||||||
|
|
||||||
return renderer;
|
return renderer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue