Jump to content
  • Advertisement
Sign in to follow this  
coreSOLO

shaders, reading 2 textures (solved)

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

In my Dx9 app, I am setting 2 textures to render as :
	dx_device->SetTexture(0,tex_src);
	dx_device->SetTexture(1,tex_base);
However in the primitive, I have defined only 1 texture coordinates. Now in my shader, I am reading them as :
sampler2D samp_maxmin;
sampler2D samp;

float4 PS_Def ( in float2 inTex : TEXCOORD ) : COLOR
{
	float4 tempCol1 = tex2D(samp_maxmin, inTex.xy);
	float4 tempCol2 = tex2D(samp, inTex.xy);
However for both the samplers, its picking color from 1st texture only. So my question is that inside a shader, how do I assign different samplers to different textures? [Edited by - coreSOLO on August 19, 2008 6:38:06 AM]

Share this post


Link to post
Share on other sites
Advertisement

texture text1;
texture text2;
sampler2D sampl = sampler_state { texture = <text1>};
sampler2D sampl2 = sampler_state { texture = <text2>};

Share this post


Link to post
Share on other sites
Thanks to some old post, i did the following and it worked :)


sampler2D samp_maxmin : register(s0);
sampler2D samp : register(s1);

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!