I have a question about using specular maps in the fixed function pipeline.
I'm using similar code to what is in the SDK documentation under Specular
Light Maps (Direct3D 9).....
// Set the base texture.
d3dDevice->SetTexture(0, lptexBaseTexture );
// Set the base texture operation and arguments.
d3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE );
d3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
d3dDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
// Set the specular light map.
d3dDevice->SetTexture(1, lptexSpecLightMap);
// Set the specular light map operation and args.
d3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_ADD );
d3dDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE );
d3dDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT );
// Set the RGB light map.
d3dDevice->SetTexture(2, lptexLightMap);
// Set the RGB light map operation and arguments.
d3dDevice->SetTextureStageState(2,D3DTSS_COLOROP, D3DTOP_MODULATE);
d3dDevice->SetTextureStageState(2,D3DTSS_COLORARG1, D3DTA_TEXTURE );
d3dDevice->SetTextureStageState(2,D3DTSS_COLORARG2, D3DTA_CURRENT );
What I see in game is not exactly what I expect. The specular values do get
added into the texture and the light map is applied over it, but it doesn't
appear that the specular highlights are changing as the camera / object moves
in relation to the light. What I'm looking for is a way to add different
areas of specularity on the same piece of geometry using the specular map.
My guess is that this sample is intended to be a static specular map, as it
doesn't really know about the camera or light because it's just a texture
added over the diffuse texture.
Does anyone know if there is a way to do a specular map using the fixed
function pipeline, or is this something that can only be done using shaders.
Thanks
-Rick