Archived

This topic is now archived and is closed to further replies.

Clamping texture coords.

This topic is 4984 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I was just following a tutorial regarding textures and DX9. However the tutorial was written with an earlier version of the DX9 SDK - can anyone explain how this method has changed and whether it is still possible to clamp a texture using IDirect3DDevice9::SetTextureStageState()?? I can''t seem to find anything on this..
g_pDevice->SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
g_pDevice->SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
 
Thanks.

Share this post


Link to post
Share on other sites
All SetTextureStageState options to do with texturing are now part of the SetSamplerState call. I think the logic behind this is that sampler states still apply when using pixel shaders, while TextureStateStages are replaced by the pixel shader.

pDev->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTEXADDRESS_CLAMP)

Share this post


Link to post
Share on other sites