Alsan
The texture stages used in DBPro have nothing to do with the UV stages of your object.
All you need to do in DBPro is make sure the texture stages used in DBPro are in the same order as the textures declared in the shader.
For example, in DBPro you might have:
load image "tex1.png", 1
load image "tex2.png", 2
load image "tex3.png", 3
load image "tex4.png", 4
texture object 1, 0, 1 ` this is the first texture stage
texture object 1, 1, 2
texture object 1, 2, 3
texture object 1, 3, 4 ` this is the last
and in the shader you might have
texture TextureMap1 <string ResourceName = "Textur 1.dds";>;
texture TextureMap2 <string ResourceName = "Textur 2.dds";>;
texture TextureMap3 <string ResourceName = "Textur 3.dds";>;
texture TextureMap4 <string ResourceName = "Textur 4.dds";>;
If you load the shader using
load effect "myEffect.fx", 1, 1
then DBPro will set the shader so it uses "Textur 1.dds", etc.
If you use
load effect "myEffect.fx", 1, 0
then DBPro will use "tex1.png" in place of "Textur 1.dds", "tex2.png" in place of "Textur 2.dds" and so on. This has nothing to do with the UV coords in your model.
You tell the shader which set of UV coords to use in the pixel shader, e.g. in your code:
PS_Output P_Shader(PS_Input In, PS_Output Out)
{ float3 RGB = tex2D(rgbSample, In.UV1).rgb;
float4 colour = RGB.r * tex2D(Tex1Sample, In.UV0)
+ RGB.g * tex2D(Tex2Sample, In.UV0)
+ RGB.b * tex2D(Tex3Sample, In.UV0);
Out.colour = colour;
return Out;
};
This tells the computer to use UV0 when looking up Tex1, Tex2 and Tex3, but UV1 when looking up the rgb map. The coords UV0 and UV1 can be any 2D coords you choose - but in this case they happen to be the stage 0 and stage 1 UV coords of your OBJECT, which are passed to the pixel shader via the input structure
struct PS_Input
{ float4 UV0 : texcoord0;
float4 UV1 : texcoord1;
};
in your shader. The semantics
texcoord0 and
texcoord0 in this case are assumed by the shader to correspond to the two sets of UV coords. If you had used a vertex shader you could over-ride that assumption with whatever you decided to put in texcoord0 and texcoord1 in the vertex shader.
This distiction between texture stages and UV stages is a common source of confusion in DBPro.