Thanks for pointing me in the right direction!

New version of TerrainPainter.fx:
Code:
//Application fed data
const float4x4 matWorld; // World matrix
texture Sand_BM, Grass_BM, Rock_BM, Snow_BM;

// ColorMap Samplers
sampler SandSampler = sampler_state 
{ 
	Texture = <Sand_BM>;
	MipFilter = Linear; 
	AddressU  = Wrap; 
	AddressV  = Wrap; 
}; 

sampler GrassSampler = sampler_state 
{ 
	Texture = <Grass_BM>;
	MipFilter = Linear; 
	AddressU  = Wrap; 
	AddressV  = Wrap; 
};  

sampler RockSampler = sampler_state 
{ 
	Texture = <Rock_BM>;
	MipFilter = Linear; 
	AddressU  = Wrap; 
	AddressV  = Wrap; 
};  

sampler SnowSampler = sampler_state 
{ 
	Texture = <Snow_BM>;
	MipFilter = Linear; 
	AddressU  = Wrap; 
	AddressV  = Wrap; 
};  

// Vertex Shader: 
void TerrPaintVS( 
in float4 InPos: POSITION, 
in float2 InTex: TEXCOORD0, 
out float2 OutTex: TEXCOORD0,
out float4 OutPos: TEXCOORD1) 
{ 
	// Transform the vertex from object space to world space: 
	OutPos = mul(InPos, matWorld); 
	// Pass the texture coordinate to the pixel shader: 
	OutTex = InTex; 
}

// Pixel Shader: 
float4 TerrPaintPS(
in float2 InTex: TEXCOORD0,
in float4 InPos: TEXCOORD1): COLOR 
{
	float4 Color;
	if(InPos.y<16)	Color = tex2D(SandSampler, InTex); 
	else if(InPos.y<50)	Color = tex2D(GrassSampler, InTex); 
	else if(InPos.y<75)	Color = tex2D(RockSampler, InTex); 
	else Color = tex2D(SnowSampler, InTex);
	
	return Color; 
} 

// Technique: 
technique AmbientTechnique 
{ 
	pass P0 
	{ 
		VertexShader = compile vs_2_0 TerrPaintVS(); 
		PixelShader  = compile ps_2_0 TerrPaintPS(); 
	} 
}



Now I get the following error:
Quote:
Malfunction W1550
Can't compile effect:
TerrainPainter.fx: error X4541: vertex shader must minimally write all four components of POSITION
D:\TERRAIN TEST\memory(70,18):
ID3DXEffectCompiler::CompileEffect: There was an error compiling expression
ID3DXEffectCompiler: Compilation failed

What have I gotten myself into? I'm starting to regret it already! (But I won't stop till I get it done, I'm too stubborn to give up so easily)


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1