Sign in to follow this  

shaders, reading 2 textures (solved)

Recommended Posts

coreSOLO    122
In my Dx9 app, I am setting 2 textures to render as :
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
XVincentX    129

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

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