Hi, how to get multiple textures on a model without the need to use separate draw calls for each texture that is on the model?
SamplerState SampleTypeWrap : register(s0);
Texture2D mTexture0 : register(t0);
Texture2D mTexture1 : register(t1);
Texture2D mTexture2 : register(t2);
struct PixelInputType
{
float4 position : SV_POSITION;
float2 tex : TEXCOORD0; // contains texture coordinates for all 3 Textures that are on the model
float3 normal : NORMAL;
};
float4 PPixelShader(PixelInputType input) : SV_TARGET
{
//need to fine how to determine what Textures(mTexture0, mTexture1, mTexture2) corresponds to the input.tex (that contains all the texture coordinates)
float4 output;
//if(this pixel have Texture mTexture0)
output = mTexture0.Sample(SampleTypeWrap, input.tex);
//if(this pixel have Texture mTexture1)
output = mTexture1.Sample(SampleTypeWrap, input.tex);
//if(this pixel have Texture mTexture2)
output = mTexture2.Sample(SampleTypeWrap, input.tex);
return output;
}
I hope i make myself clear.