Here's the effect:

Code:
float4x4 matWorldViewProj;
float4x4 matWorld;


float  Thickness = 10;
float4 Color = {0, 0, 0, 1};



struct VS_IN
{
	float4 Pos	: POSITION;
	float3 Nor	: NORMAL;
}

struct VS_OUT
{
	float4 Pos	: POSITION;
}


VS_OUT VS(VS_IN In)
{
	VS_OUT Out;
	//
	Out.Pos = mul(In.Pos, matWorldViewProj);
	float3 wNor = normalize(mul(In.Nor, matWorld));
	Out.Pos.xyz += wNor * Thickness;
}


float4 PS() : COLOR
{
	return Color;
}


technique metaloutline
{
    pass p1
    {
    	cullMode = CW;
        VertexShader = compile vs_2_0 VS();
        PixelShader = compile ps_2_0 PS();
    }
    pass p2
    {
    	cullMode = CCW;
        VertexShader = null;
        PixelShader = null;
    }
}



...I just wrote this, it's untested. Adjust the variables "Thickness" & "Color" to your needs. If it doesn't work, hopefully someone can spot the problem and fix it because I'm barely on the boards anymore... good luck.


xXxGuitar511
- Programmer