d3d9 samplers :
////////////.fxsampler ColorSampler = sampler_state{ Texture = <ColorTexture>;};sampler DecalSampler = sampler_state{ Texture = <DecalTexture>;};///////////.cpp//set ColorSamplerSamplerIndex = 0;m_pd3dDevice->SetSamplerState( SamplerIndex, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);m_pd3dDevice->SetSamplerState( SamplerIndex, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);//set DecalSamplerSamplerIndex = 1m_pd3dDevice->SetSamplerState( SamplerIndex, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);m_pd3dDevice->SetSamplerState( SamplerIndex, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
d3d10 samplers :
///////////.fxSamplerState ColorSampler{ //Filter = MIN_MAG_MIP_LINEAR;};SamplerState DecalSampler{ //Filter = MIN_MAG_MIP_LINEAR;};/////////// .cppD3D10_SAMPLER_DESC desc;ZeroMemory( &desc, sizeof(D3D10_SAMPLER_DESC) );desc.Filter = D3D10_FILTER_MIN_MAG_MIP_POINT;desc.AddressU = D3D10_TEXTURE_ADDRESS_WRAP;desc.AddressV = D3D10_TEXTURE_ADDRESS_WRAP;desc.MinLOD = 0.f;desc.MaxLOD = D3D10_FLOAT32_MAX;desc.MipLODBias = 0.f;desc.MaxAnisotropy = 16;desc.ComparisonFunc = D3D10_COMPARISON_NEVER;ID3D10SamplerState *SamplerState = NULL;m_pd3dDevice->CreateSamplerState( &desc, &SamplerState );m_pd3dDevice->PSSetSamplers( 0, 1, &SamplerState );// WHERE DO I SPECIFY THE SAMPLER INDEX? Or say that I want DecalSampler to use this sampler state?
[Edited by - 16bit_port on September 28, 2010 3:32:05 PM]