Sign in to follow this  
JoeyBlow2

New to effects. How to set texture in sampler?

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

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