Jump to content
  • Advertisement
Sign in to follow this  
Game_XinBing

About SetTexture and Pixel Shader binding problem

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

I want to know how the SetTexture's texture outside pixel shader binding to texture in pixel shader...... ......I want to set some texture SetTexture(0, pTexBase); SetTexture(1, pTexLightmap); ...... SetTexture(n, pTexn); but...how these textures binding with texture in Pixel Shader (Pixel Shader) texture texBase texture texLightmap ...... texture texTexn how pTexBase & texBase binding(one to one relationship) how pTexLightmap & texLightmap binding(one to one relationship) ...... how pTexn & texTexn binding(one to one relationship) (I use DX9 and hlsl) Thanks You!!!

Share this post


Link to post
Share on other sites
Advertisement
I'm not really sure what you're asking, but I think you might want to search for more information about samplers (sampler2D) or UV coordinates (texcoord0)... but I think you're looking for samplers.

Share this post


Link to post
Share on other sites
You can force a shader texture slot to use a given texture register:


texture diffuseMap : register(t0);
texture lightMap : register(t1);





Then, diffuseMap and lightMap can be set via SetTexture(0) and SetTexture(1) respectively.

If you don't want to force the registers like in the above example, you can use the ID3DXConstantTable interface to find the texture slots given their names, after you've compiled the shader.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!