Jump to content
  • Advertisement
Sign in to follow this  
JoeyBlow2

New to effects. How to set texture in sampler?

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

Sorry for the noobie question. I have the effect code:


// sampler
sampler Sampler = sampler_state
{
    Texture   = (Tex0);
    MipFilter = LINEAR;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
};

And I'm trying to set the texture into that? How would I do that?

    V_RETURN( g_pEffect->SetTexture( "Sampler.Texture", g_pMeshTexture) );

Doesn't work.

Share this post


Link to post
Share on other sites
Advertisement
In youre code use

V_RETURN( g_pEffect->SetTexture( "g_MeshTexture", g_pMeshTexture) );



and in your .fx file use

texture g_MeshTexture;

// sampler
sampler Sampler = sampler_state
{
Texture = <g_MeshTexture>;
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
};



Cambo_frog

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!