I've found this pxs_retroshader for Unity.

And there was this part in it:
Code
#define TRANSFORM_TEX(tex,name) (tex.xy * name##_ST.xy + name##_ST.zw)

float distance = length(mul(UNITY_MATRIX_MV,v.vertex));

//Affine Texture Mapping
float4 affinePos = vertex;//vertex;				
o.uv_MainTex = TRANSFORM_TEX(v.texcoord, _MainTex);
o.uv_MainTex *= distance + (vertex.w*(UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;
o.normal = distance + (vertex.w*(UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;
After googling around, I came up with this results:
Code
const float4x4 matWorldViewProj;
const float4x4 matWorld; 
texture entSkin1; 

// Color map sampler
sampler ColorMapSampler = sampler_state 
{ 
	Texture = <entSkin1>; 
}; 

// Vertex Shader: 
void DiffuseVS( 
in float4 InPos: POSITION, 
in float3 InNormal: NORMAL, 
in float2 InTex: TEXCOORD0, 
out float4 OutPos: POSITION, 
out float2 OutTex: TEXCOORD0, 
out float3 OutNormal: TEXCOORD1) 
{
	float distance = length(mul(InPos, matWorldViewProj));
	OutPos = mul(InPos, matWorldViewProj); 
	OutPos *= distance + (OutPos.w * (0.1)) / distance / 2;
	//OutNormal = distance + (OutPos.w * (0.1)) / distance / 2;
	OutNormal = normalize(mul(InNormal, matWorld));
	OutTex = InTex; 
} 

// Pixel Shader: 
float4 DiffusePS( 
in float2 InTex: TEXCOORD0, 
in float3 InNormal: TEXCOORD1): COLOR 
{ 
	return tex2D(ColorMapSampler, InTex); 
} 

// Technique: 
technique AffineTechnique 
{ 
	pass P0 
	{ 
		VertexShader = compile vs_2_0 DiffuseVS(); 
		PixelShader  = compile ps_2_0 DiffusePS(); 
	} 
}
But I'm not sure, if I've done it correctly grin
[Linked Image]


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung