bump
Dumped 2 shaders:
//Cg
void vshader(float4 vtx_position : POSITION,
out float4 l_position : POSITION,
uniform float4 texpad_txcolor,
uniform float4 texpix_txcolor,
out float4 l_texcoordC : TEXCOORD0,
uniform float4 texpad_txblur1,
out float4 l_texcoordBS : TEXCOORD3,
uniform float4x4 mat_modelproj)
{
l_position=mul(mat_modelproj, vtx_position);
l_texcoordC=(vtx_position.xzxz * texpad_txcolor) + texpad_txcolor;
l_texcoordBS=(vtx_position.xzxz * texpad_txblur1) + texpad_txblur1;
}
void fshader(
float4 l_texcoordC : TEXCOORD0,
uniform float4 texpix_txcolor,
float4 l_texcoordBS : TEXCOORD3,
uniform float4 k_blurval,
uniform sampler2D k_txcolor,
uniform sampler2D k_txblur0,
uniform sampler2D k_txblur1,
out float4 o_color : COLOR)
{
o_color = tex2D(k_txcolor, l_texcoordC.xy);
o_color = lerp(tex2D(k_txblur1, l_texcoordBS.xy), o_color, k_blurval.x);
}
for those of you who know Cg, is this a correct shader file (or maybe corrupt)? So I’ll know if its worth setting all the inputs manually.
Hm, looks like there are some blurring functions…
and
//Cg
void vshader(
in float4 vtx_texcoord0 : TEXCOORD0,
out float4 l_texcoord0 : TEXCOORD0,
uniform float4x4 trans_model_to_world,
out float4 l_world_position : TEXCOORD1,
uniform float4x4 trans_model_to_view,
out float4 l_eye_position : TEXCOORD2,
uniform float4x4 tpose_view_to_model,
out float4 l_eye_normal : TEXCOORD3,
in float4 vtx_normal : TEXCOORD1,
float4 vtx_position : POSITION,
out float4 l_position : POSITION,
uniform float4x4 mat_modelproj
) {
l_position = mul(mat_modelproj, vtx_position);
l_world_position = mul(trans_model_to_world, vtx_position);
l_eye_position = mul(trans_model_to_view, vtx_position);
l_eye_normal.xyz = mul((float3x3)tpose_view_to_model, vtx_normal.xyz);
l_eye_normal.w = 0;
}
void fshader(
in float4 l_world_position : TEXCOORD1,
in float4 l_eye_position : TEXCOORD2,
in float4 l_eye_normal : TEXCOORD3,
uniform sampler2D tex_0,
uniform float4x4 texmat_0,
uniform float4 alight_alight0,
uniform float4x4 dlight_dlight0_rel_view,
out float4 o_color : COLOR0,
uniform float4 attr_color,
uniform float4 attr_colorscale
) {
float4 result;
float4 l_texcoord0 = l_world_position;
l_texcoord0 = mul(texmat_0, l_texcoord0);
l_texcoord0.xyz /= l_texcoord0.w;
// Fetch all textures.
float4 tex0 = tex2D(tex_0, l_texcoord0.xy);
// Correct the surface normal for interpolation effects
l_eye_normal.xyz = normalize(l_eye_normal.xyz);
// Begin view-space light calculations
float ldist,lattenv,langle;
float4 lcolor,lspec,lvec,lpoint,latten,ldir,leye,lhalf; float4 tot_ambient = float4(0,0,0,0);
float4 tot_diffuse = float4(0,0,0,0);
// Ambient Light 0
lcolor = alight_alight0;
tot_ambient += lcolor;
// Directional Light 0
lcolor = dlight_dlight0_rel_view[0];
lspec = dlight_dlight0_rel_view[1];
lvec = dlight_dlight0_rel_view[2];
lcolor *= saturate(dot(l_eye_normal.xyz, lvec.xyz));
tot_diffuse += lcolor;
// Begin view-space light summation
result = float4(0,0,0,0);
result += tot_ambient;
result += tot_diffuse;
result = saturate(result);
// End view-space light calculations
result.rgb = lerp(result, tex0 * float4(0, 0, 0, 1), tex0.r).rgb;
result *= attr_colorscale;
o_color = result * 1.000001;
}