Sign in to follow this  

New to effects. How to set texture in sampler?

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

This topic is 4869 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this