   Can anyone help me convert this HLSL shader to a CG shader?
  As I understand it should be super easy to do but I'm not sure which commands I need to replace. Hope someone who uses CG can look over this for me:Texture2D txDiffuse;SamplerState samLinear{Filter = MIN_MAG_MIP_LINEAR;AddressU = Wrap;    AddressV = Wrap;};TextureCube txEnvironment;SamplerState envSampler{Filter = MIN_MAG_MIP_LINEAR;AddressU = Clamp;AddressV = Clamp;AddressW = Clamp;};float4 Ambient = float4( 0.0f, 0.0f, 0.0f, 1.0f );float4 Diffuse = float4( 0.75f, 0.75f, 0.75f, 1.0f );float Environment_map_intensity = 1.0f;int Light_Count: LIGHTCOUNT;float4 ViewPos: VIEWPOS;float4 Lights[255]: LIGHTARRAY;float4 LightColors[255]: LIGHTCOLORARRAY;float4x4 World: WORLD;float4x4 View: WORLDVIEW;float4x4 Projection: PROJECTION;float4x4 Bones[255]: BONEARRAY;struct VS_INPUT{float3 pos: POSITION;float3 norm: NORMAL;float2 tex: TEXCOORD0;float4 bw: TEXCOORD1;float4 bi: TEXCOORD2;};struct PS_INPUT{float4 posVS: SV_POSITION;float4 posWS: POSITION;float2 tex: TEXCOORD0;float4 norm: NORMAL;};PS_INPUT VS( VS_INPUT In ){PS_INPUT Out = (PS_INPUT)0;float4x4 skinTransform = 0;float3x3 normTransform = 0;skinTransform += Bones[In.bi.x] * In.bw.x;skinTransform += Bones[In.bi.y] * In.bw.y;skinTransform += Bones[In.bi.z] * In.bw.z;skinTransform += Bones[In.bi.w] * In.bw.w;normTransform += (float3x3)(Bones[In.bi.x] * In.bw.x);normTransform += (float3x3)(Bones[In.bi.y] * In.bw.y);normTransform += (float3x3)(Bones[In.bi.z] * In.bw.z);normTransform += (float3x3)(Bones[In.bi.w] * In.bw.w);Out.posVS = mul(float4(In.pos, 1), skinTransform);Out.posWS = Out.posVS;Out.norm = float4(mul(In.norm, normTransform), 0);Out.posVS = mul(mul(Out.posVS, View), Projection);Out.tex = In.tex;return Out;}float4 PS( PS_INPUT In) : SV_Target{float4 light = float4( 0, 0, 0, 0 );float txWidth, txHeight;txEnvironment.GetDimensions(txWidth, txHeight);float4 envColor = float4( 0, 0, 0, 1 );if(txWidth > 0){envColor = Environment_map_intensity * txEnvironment.Sample( envSampler, reflect( normalize( In.posWS.xyz - ViewPos.xyz ), In.norm.xyz ) );}txDiffuse.GetDimensions(txWidth, txHeight);float4 texColor = float4( 1, 1, 1, 1 );if(txWidth > 0){texColor = txDiffuse.Sample( samLinear, In.tex );}for(int i = 0; i < Light_Count; i++){float4 lightDir = Lights - In.posWS;float4 NdotL = saturate(dot(In.norm, normalize(lightDir)));float4 attenuation = 1/length(lightDir);light += LightColors * NdotL * attenuation * 10;}light.w = 1;return ( ((texColor + envColor) * Diffuse) * (light + Ambient) );}technique10 Render{pass P0{SetVertexShader( CompileShader( vs_4_0, VS() ) );SetGeometryShader( NULL );SetPixelShader( CompileShader( ps_4_0, PS() ) );}}