Sorry, I've been banned for ~10 days...
I'll just post the code:
Code:
texture mtlSkin1;
float4x4 matWorldViewProj;
float4x4 matWorldView;
float fAlpha;
sampler imageTex = sampler_state
{
Texture = <mtlSkin1>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = wrap;
AddressV = wrap;
};
struct vIn
{
float4 Pos : POSITION;
};
struct vOut
{
float4 Pos : POSITION;
float3 Tex : TEXCOORD0;
};
struct pIn
{
float3 Tex : TEXCOORD0;
};
vOut pVS (vIn In)
{
vOut Out = (vOut)0;
Out.Pos = mul(In.Pos, matWorldViewProj);
Out.Tex = mul(In.Pos, matWorldView).xyz;
//
return(Out);
}
float4 pPS (pIn In) : COLOR
{
float2 tPos = In.Tex.xy/In.Tex.z;
//
tPos.y = 1 - (tPos.y*1.135 + 0.5);
tPos.x = tPos.x*0.855 + 0.5;
//
float4 color = tex2D(imageTex, tPos);
color.a *= fAlpha;
//
return(color);
}
technique portalView
{
pass one
{
VertexShader = compile vs_1_1 pVS();
PixelShader = compile ps_2_0 pPS();
}
}
Kepp in mind that this uses material.skin1, not model.skin1...