Jump to content
  • Advertisement
Sign in to follow this  
wforl

Set texture by Index

This topic is 3161 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

Under Directx10, using the ID3D10Effect type, is it possible to set a texture by index, rather than using an Effect Variable handle? Im wanting to do something like the following // .fx
Texture2D gDiffuse: register(t34);
Texture2D gSpecular : register(t35);



// .cpp
myEffect->SetTextureByIndex( 34, Diffuse );
myEffect->SetTextureByIndex( 35, Specular );



I cant see anyway of doing this under the ID3D10Effect type. The only way I can see is using the ID3D10Device. But was just curious if there was a way through the ID3D10Effect type.
void ID3D10Device::PSSetShaderResources(
  UINT StartSlot,
  UINT NumViews,
  ID3D10ShaderResourceView *const *ppShaderResourceViews
);
//and
void ID3D10Device::VSSetShaderResources(
  UINT StartSlot,
  UINT NumViews,
  ID3D10ShaderResourceView *const *ppShaderResourceViews
);



Share this post


Link to post
Share on other sites
Advertisement
Another thing I was wondering is how to get the register of a texture? so if I have an effect loaded, how can I search that effect for a texture by name and then retrieve its register?

The reason for this is a little projet im doing, so that rather than using handles, i simply store the register and then use PSSetShaderResources()

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!