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;
}
}