Monk is right.
Regarding your attempt at 6 channels:
Quote: "Now here is the code I edited to see if I could use two rgb maps with different names.Basicly I just copied and pasted the code again and change the names."
it won't work like that. If it works at all, the shader compiler probably ignores the first set of declarations and uses the last one it sees.
What you need to do is something like the following. Change this:
texture detailMap1 <string ResourceName = "brick.png";>;
sampler2D detailSample1 = sampler_state
{texture = (detailMap1);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
texture detailMap2 <string ResourceName = "water.png";>;
sampler2D detailSample2 = sampler_state
{texture = (detailMap2);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
texture detailMap3 <string ResourceName = "snow,png";>;
sampler2D detailSample3 = sampler_state
{texture = (detailMap3);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
texture rgbMap <string ResourceName = "rgb map.png";>;
sampler2D rgbSample = sampler_state
{texture = (rgbMap);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
to this:
texture detailMap1 <string ResourceName = "brick.png";>;
sampler2D detailSample1 = sampler_state
{texture = (detailMap1);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
texture detailMap2 <string ResourceName = "water.png";>;
sampler2D detailSample2 = sampler_state
{texture = (detailMap2);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
texture detailMap3 <string ResourceName = "snow.png";>;
sampler2D detailSample3 = sampler_state
{texture = (detailMap3);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
texture rgbMap <string ResourceName = "rgb map.png";>;
sampler2D rgbSample = sampler_state
{texture = (rgbMap);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
texture detailMap4 <string ResourceName = "grass.png";>;
sampler2D detailSample4 = sampler_state
{texture = (detailMap4);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
texture detailMap5 <string ResourceName = "sand.png";>;
sampler2D detailSample5 = sampler_state
{texture = (detailMap5);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
texture detailMap6 <string ResourceName = "rock.png";>;
sampler2D detailSample6 = sampler_state
{texture = (detailMap6);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
texture rgbMap1 <string ResourceName = "rgbone map.png";>;
sampler2D rgbSample1 = sampler_state
{texture = (rgbMap1);
minfilter = linear;
magfilter = linear;
mipfilter = linear;
addressU = wrap;
addressV = wrap;
};
Notice that each of the 8 textures and associated samplers has its own name in the above declarations, e.g. you are using two different RGB maps so they need to be given different names, e.g. rgbMap and rgbMap1 and the samplers need different names as well, e.g. rgbSample and rgbSample1.
The next thing to change is the pixel shader code so it uses all 8 textures. Change this:
PS_Output P_Shader(PS_Input In, PS_Output Out)
{ float4 rgbColours = tex2D(rgbSample,In.UV);
float4 baseColour = tex2D(detailSample1,repeatScale*In.UV)*rgbColours.r;
baseColour += tex2D(detailSample2,repeatScale*In.UV)*rgbColours.g;
baseColour += tex2D(detailSample3,repeatScale*In.UV)*rgbColours.b;
Out.colour = baseColour;
return Out;
};
to this:
PS_Output P_Shader(PS_Input In, PS_Output Out)
{ // read the first RGB map and first three textures
float4 rgbColours = tex2D(rgbSample,In.UV);
float4 baseColour = tex2D(detailSample1,repeatScale*In.UV)*rgbColours.r;
baseColour += tex2D(detailSample2,repeatScale*In.UV)*rgbColours.g;
baseColour += tex2D(detailSample3,repeatScale*In.UV)*rgbColours.b;
// read the second RGB map and second three textures
rgbColours = tex2D(rgbSample1,In.UV);
baseColour += tex2D(detailSample4,repeatScale*In.UV)*rgbColours.r;
baseColour += tex2D(detailSample5,repeatScale*In.UV)*rgbColours.g;
baseColour += tex2D(detailSample6,repeatScale*In.UV)*rgbColours.b;
Out.colour = baseColour;
return Out;
};
The next thing to remember is that the sum of all six RGB components from the two RGB maps must equal 255 (unless you want to make parts of the map especially dark or bright).
That should work (I've checked it compiles but haven't tested it). Any problems post back.
Edit Corrected careless copy and paste.