Usage of Fog

Yes, excellent work.
EDIT: tested on this: [Shader-less Shadows)
worked fine

I’ve downloaded a snapshot(376) build from: panda3d.org/buildbot/builds/ … 13-376.exe and I tried to add fog to my scene but got only a set of warnings and the display kicked back into fix-function pipeline.
My code:
#fog
self.fog = Fog(“global-fog”)
self.fog.setColor(1,1,1)
self.fog.setExpDensity(0.002)
render.setFog(self.fog)

I’ve downloaded a snapshot(376) build from: panda3d.org/buildbot/builds/ … 13-376.exe and I tried to add fog to my scene but got only a set of warnings and the display kicked back into fix-function pipeline.
My code:

        render.setShaderAuto()
        #fog
        self.fog = Fog("global-fog")
        self.fog.setColor(1,1,1)
        self.fog.setExpDensity(0.002)
        render.setFog(self.fog)

Error message:

:gobj(error): created-shader: (128) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (21) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (125) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (125) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (125) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (128) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (21) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (125) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (125) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (125) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.

What am I doing wrong? Or did I just install a wrong version?

Odd. Those errors don’t have anything to do with fog, rather with spotlight shadows.

Firs of all sorry for the double post, must have missclicked.

And I do use spotlight shadows with setShadowCaster(). When I turn them off the fog stars to work :open_mouth:

Can’t I have both?

Hmm… does it work when you put “basic-shaders-only #f” in your Config.prc?

I’ll check that.
I haven’t changed the config file, so the default setting was on (#f?).

I’m runing it on an anchient gpu (gf 6200) with old drivers (newer give me a blue screen of death from time to time), but somehow I don’t think that’s the problem.

#f or 0 is off. #t or 1 is on.

It might be your old graphics card. Maybe you’ve just reached the limit of the number of bound parameters.

basic-shaders-only #f
or
basic-shaders-only #t

It’s still the same :frowning:

It runs fine with just shadows just as it runs fine with just fog. I just can’t believe that’s my graphic cards fault, I’ve run game on it that have shadows, fog, per pixel lights, normal, gloss and glow mapping and a post process bloom filter. Sure they run at 15fps but they do run.

Is there anyway that I can confirm this is the limit for my machine? I don’t have anything else to test it on…

I can’t live without for, it just makes the outdoor scenes so much better, with:
img259.imageshack.us/img259/8902/fog2.jpg
without:
img405.imageshack.us/img405/6963/nofog.jpg

…so if I really deemed(or damned)to use the post-process filter that preusser posted… did anybody managed to get good results with it? All I get is a grey layer.

Try setting dump-generated-shaders to #t, finding the shader that gives the problem and posting it here.

Ok, so I got this:

:gobj(warning): Dumping shader: genshader0
:gobj(error): created-shader: (128) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (21) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): created-shader: (125) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(warning): Dumping shader: genshader1
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(warning): Dumping shader: genshader2
:gobj(error): created-shader: (125) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(warning): Dumping shader: genshader3
:gobj(error): created-shader: (125) : warning C7011: implicit cast from "float4"
 to "float3"
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(warning): Dumping shader: genshader4
:gobj(warning): Dumping shader: genshader5
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(warning): Dumping shader: genshader6
:gobj(error): created-shader: (19) : error C5041: cannot locate suitable resourc
e to bind parameter "l_slightcoord0"
:gobj(error): Shader encountered an error.
:gobj(warning): Dumping shader: genshader7
:gobj(warning): Dumping shader: genshader8
:gobj(warning): Dumping shader: genshader9
:gobj(warning): Dumping shader: genshader10
:gobj(warning): Dumping shader: genshader11
:gobj(warning): Dumping shader: genshader12
:gobj(warning): Dumping shader: genshader13
:gobj(warning): Dumping shader: genshader14
:gobj(warning): Dumping shader: genshader15
:gobj(warning): Dumping shader: genshader16
:gobj(warning): Dumping shader: genshader17
:gobj(warning): Dumping shader: genshader18
:gobj(warning): Dumping shader: genshader19
:gobj(warning): Dumping shader: genshader20
:gobj(warning): Dumping shader: genshader21
:gobj(warning): Dumping shader: genshader22
:gobj(warning): Dumping shader: genshader23
:gobj(warning): Dumping shader: genshader24
:gobj(warning): Dumping shader: genshader25
:gobj(warning): Dumping shader: genshader26

genshader0:

//Cg
void vshader(
	 in float4 vtx_texcoord0 : TEXCOORD0,
	 out float4 l_texcoord0 : TEXCOORD0,
	 in float4 vtx_texcoord1 : TEXCOORD1,
	 out float4 l_texcoord1 : TEXCOORD1,
	 in float4 vtx_texcoord2 : TEXCOORD2,
	 out float4 l_texcoord2 : TEXCOORD2,
	 in float4 vtx_color : COLOR,
	 out float4 l_color : COLOR,
	 uniform float4x4 trans_model_to_view,
	 out float4 l_eye_position : TEXCOORD3,
	 uniform float4x4 tpose_view_to_model,
	 out float4 l_eye_normal : TEXCOORD4,
	 in float4 vtx_normal : TEXCOORD3,
	 in float4 vtx_tangent2 : TEXCOORD4,
	 in float4 vtx_binormal2 : TEXCOORD5,
	 out float4 l_tangent : TEXCOORD5,
	 out float4 l_binormal : TEXCOORD6,
	 uniform float4x4 trans_model_to_clip_of_slight0,
	 out float4 l_slightcoord0,
	 out float4 l_hpos : TEXCOORD7,
	 float4 vtx_position : POSITION,
	 out float4 l_position : POSITION,
	 uniform float4x4 mat_modelproj
) {
	 l_position = mul(mat_modelproj, vtx_position);
	 l_hpos = l_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;
	 l_texcoord0 = vtx_texcoord0;
	 l_texcoord1 = vtx_texcoord1;
	 l_texcoord2 = vtx_texcoord2;
	 l_color = vtx_color;
	 l_tangent.xyz = mul((float3x3)tpose_view_to_model, vtx_tangent2.xyz);
	 l_tangent.w = 0;
	 l_binormal.xyz = mul((float3x3)tpose_view_to_model, -vtx_binormal2.xyz);
	 l_binormal.w = 0;
	 float4x4 biasmat = {0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f};
	 l_slightcoord0 = mul(biasmat, mul(trans_model_to_clip_of_slight0, vtx_position));
}

void fshader(
	 in float4 l_hpos : TEXCOORD7,
	 in uniform float4 attr_fog,
	 in uniform float4 attr_fogcolor,
	 in float4 l_eye_position : TEXCOORD3,
	 in float4 l_eye_normal : TEXCOORD4,
	 uniform sampler2D tex_0,
	 in float4 l_texcoord0 : TEXCOORD0,
	 uniform sampler2D tex_1,
	 in float4 l_texcoord1 : TEXCOORD1,
	 uniform sampler2D tex_2,
	 in float4 l_texcoord2 : TEXCOORD2,
	 in float3 l_tangent : TEXCOORD5,
	 in float3 l_binormal : TEXCOORD6,
	 uniform float4 alight_alight0,
	 uniform float4x4 dlight_dlight0_rel_view,
	 uniform float4x4 slight_slight0_rel_view,
	 uniform float4   satten_slight0,
	 uniform sampler2DShadow k_slighttex0,
	 float4 l_slightcoord0,
	 uniform float4 row1_view_to_model,
	 out float4 o_color : COLOR0,
	 in float4 l_color : COLOR,
	 uniform float4 attr_colorscale
) {
	 float4 result;
	 // Fetch all textures.
	 float4 tex0 = tex2D(tex_0, l_texcoord0.xy);
	 float4 tex1 = tex2D(tex_1, l_texcoord1.xy);
	 float4 tex2 = tex2D(tex_2, l_texcoord2.xy);
	 // Translate tangent-space normal in map to view-space.
	 float3 tsnormal = ((float3)tex2 * 2) - 1;
	 l_eye_normal.xyz *= tsnormal.z;
	 l_eye_normal.xyz += l_tangent * tsnormal.x;
	 l_eye_normal.xyz += l_binormal * tsnormal.y;
	 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;
	 float lshad;
	 float4 tot_ambient = float4(0,0,0,0);
	 float4 tot_diffuse = float4(0,0,0,0);
	 float4 tot_specular = float4(0,0,0,0);
	 float shininess = 50; // no shininess specified, using default
	 // 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;
	 lhalf = dlight_dlight0_rel_view[3];
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // Spot Light 0
	 lcolor = slight_slight0_rel_view[0];
	 lspec  = slight_slight0_rel_view[1];
	 lpoint = slight_slight0_rel_view[2];
	 ldir   = slight_slight0_rel_view[3];
	 latten = satten_slight0;
	 lvec   = lpoint - l_eye_position;
	 ldist  = length(float3(lvec));
	 lvec /= ldist;
	 langle = saturate(dot(ldir.xyz, lvec.xyz));
	 lattenv = 1/(latten.x + latten.y*ldist + latten.z*ldist*ldist);
	 lattenv *= pow(langle, latten.w);
	 if (langle < ldir.w) lattenv = 0;
	 lcolor *= lattenv * saturate(dot(l_eye_normal.xyz, lvec.xyz));
	 lshad = shadow2DProj(k_slighttex0, l_slightcoord0).r;
	 lcolor *= lshad;
	 lspec *= lshad;
	 tot_diffuse += lcolor;
	 lhalf = normalize(lvec - float4(0,1,0,0));
	 lspec *= lattenv;
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // Begin view-space light summation
	 result = float4(0,0,0,0);
	 result += tot_ambient * l_color;
	 result += tot_diffuse * l_color;
	 result = saturate(result);
	 // End view-space light calculations
	 result.rgb *= tex0;
	 result *= attr_colorscale;
	 tot_specular *= tex1.a;
	 result.rgb = result.rgb + tot_specular.rgb;
	 result.rgb = lerp(attr_fogcolor.rgb, result.rgb, saturate(exp2(attr_fog.x * attr_fog.x * l_hpos.z * l_hpos.z * -1.442695f)));
	 o_color = result * 1.000001;
}

genshader1:

//Cg
void vshader(
	 in float4 vtx_texcoord0 : TEXCOORD0,
	 out float4 l_texcoord0 : TEXCOORD0,
	 in float4 vtx_texcoord1 : TEXCOORD1,
	 out float4 l_texcoord1 : TEXCOORD1,
	 in float4 vtx_texcoord2 : TEXCOORD2,
	 out float4 l_texcoord2 : TEXCOORD2,
	 uniform float4x4 trans_model_to_view,
	 out float4 l_eye_position : TEXCOORD3,
	 uniform float4x4 tpose_view_to_model,
	 out float4 l_eye_normal : TEXCOORD4,
	 in float4 vtx_normal : TEXCOORD3,
	 in float4 vtx_tangent2 : TEXCOORD4,
	 in float4 vtx_binormal2 : TEXCOORD5,
	 out float4 l_tangent : TEXCOORD5,
	 out float4 l_binormal : TEXCOORD6,
	 uniform float4x4 trans_model_to_clip_of_slight0,
	 out float4 l_slightcoord0,
	 out float4 l_hpos : TEXCOORD7,
	 float4 vtx_position : POSITION,
	 out float4 l_position : POSITION,
	 uniform float4x4 mat_modelproj
) {
	 l_position = mul(mat_modelproj, vtx_position);
	 l_hpos = l_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;
	 l_texcoord0 = vtx_texcoord0;
	 l_texcoord1 = vtx_texcoord1;
	 l_texcoord2 = vtx_texcoord2;
	 l_tangent.xyz = mul((float3x3)tpose_view_to_model, vtx_tangent2.xyz);
	 l_tangent.w = 0;
	 l_binormal.xyz = mul((float3x3)tpose_view_to_model, -vtx_binormal2.xyz);
	 l_binormal.w = 0;
	 float4x4 biasmat = {0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f};
	 l_slightcoord0 = mul(biasmat, mul(trans_model_to_clip_of_slight0, vtx_position));
}

void fshader(
	 in float4 l_hpos : TEXCOORD7,
	 in uniform float4 attr_fog,
	 in uniform float4 attr_fogcolor,
	 in float4 l_eye_position : TEXCOORD3,
	 in float4 l_eye_normal : TEXCOORD4,
	 uniform sampler2D tex_0,
	 in float4 l_texcoord0 : TEXCOORD0,
	 uniform sampler2D tex_1,
	 in float4 l_texcoord1 : TEXCOORD1,
	 uniform sampler2D tex_2,
	 in float4 l_texcoord2 : TEXCOORD2,
	 in float3 l_tangent : TEXCOORD5,
	 in float3 l_binormal : TEXCOORD6,
	 uniform float4 alight_alight0,
	 uniform float4x4 dlight_dlight0_rel_view,
	 uniform float4x4 slight_slight0_rel_view,
	 uniform float4   satten_slight0,
	 uniform sampler2DShadow k_slighttex0,
	 float4 l_slightcoord0,
	 uniform float4 row1_view_to_model,
	 out float4 o_color : COLOR0,
	 uniform float4 attr_color,
	 uniform float4 attr_colorscale
) {
	 float4 result;
	 // Fetch all textures.
	 float4 tex0 = tex2D(tex_0, l_texcoord0.xy);
	 float4 tex1 = tex2D(tex_1, l_texcoord1.xy);
	 float4 tex2 = tex2D(tex_2, l_texcoord2.xy);
	 // Translate tangent-space normal in map to view-space.
	 float3 tsnormal = ((float3)tex2 * 2) - 1;
	 l_eye_normal.xyz *= tsnormal.z;
	 l_eye_normal.xyz += l_tangent * tsnormal.x;
	 l_eye_normal.xyz += l_binormal * tsnormal.y;
	 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;
	 float lshad;
	 float4 tot_ambient = float4(0,0,0,0);
	 float4 tot_diffuse = float4(0,0,0,0);
	 float4 tot_specular = float4(0,0,0,0);
	 float shininess = 50; // no shininess specified, using default
	 // 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;
	 lhalf = dlight_dlight0_rel_view[3];
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // Spot Light 0
	 lcolor = slight_slight0_rel_view[0];
	 lspec  = slight_slight0_rel_view[1];
	 lpoint = slight_slight0_rel_view[2];
	 ldir   = slight_slight0_rel_view[3];
	 latten = satten_slight0;
	 lvec   = lpoint - l_eye_position;
	 ldist  = length(float3(lvec));
	 lvec /= ldist;
	 langle = saturate(dot(ldir.xyz, lvec.xyz));
	 lattenv = 1/(latten.x + latten.y*ldist + latten.z*ldist*ldist);
	 lattenv *= pow(langle, latten.w);
	 if (langle < ldir.w) lattenv = 0;
	 lcolor *= lattenv * saturate(dot(l_eye_normal.xyz, lvec.xyz));
	 lshad = shadow2DProj(k_slighttex0, l_slightcoord0).r;
	 lcolor *= lshad;
	 lspec *= lshad;
	 tot_diffuse += lcolor;
	 lhalf = normalize(lvec - float4(0,1,0,0));
	 lspec *= lattenv;
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // 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 *= tex0;
	 result *= attr_colorscale;
	 tot_specular *= tex1.a;
	 result.rgb = result.rgb + tot_specular.rgb;
	 result.rgb = lerp(attr_fogcolor.rgb, result.rgb, saturate(exp2(attr_fog.x * attr_fog.x * l_hpos.z * l_hpos.z * -1.442695f)));
	 o_color = result * 1.000001;
}

genshader2

//Cg
void vshader(
	 in float4 vtx_texcoord0 : TEXCOORD0,
	 out float4 l_texcoord0 : TEXCOORD0,
	 in float4 vtx_texcoord1 : TEXCOORD1,
	 out float4 l_texcoord1 : TEXCOORD1,
	 in float4 vtx_texcoord2 : TEXCOORD2,
	 out float4 l_texcoord2 : TEXCOORD2,
	 uniform float4x4 trans_model_to_view,
	 out float4 l_eye_position : TEXCOORD3,
	 uniform float4x4 tpose_view_to_model,
	 out float4 l_eye_normal : TEXCOORD4,
	 in float4 vtx_normal : TEXCOORD3,
	 in float4 vtx_tangent2 : TEXCOORD4,
	 in float4 vtx_binormal2 : TEXCOORD5,
	 out float4 l_tangent : TEXCOORD5,
	 out float4 l_binormal : TEXCOORD6,
	 uniform float4x4 trans_model_to_clip_of_slight0,
	 out float4 l_slightcoord0,
	 out float4 l_hpos : TEXCOORD7,
	 float4 vtx_position : POSITION,
	 out float4 l_position : POSITION,
	 uniform float4x4 mat_modelproj
) {
	 l_position = mul(mat_modelproj, vtx_position);
	 l_hpos = l_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;
	 l_texcoord0 = vtx_texcoord0;
	 l_texcoord1 = vtx_texcoord1;
	 l_texcoord2 = vtx_texcoord2;
	 l_tangent.xyz = mul((float3x3)tpose_view_to_model, vtx_tangent2.xyz);
	 l_tangent.w = 0;
	 l_binormal.xyz = mul((float3x3)tpose_view_to_model, -vtx_binormal2.xyz);
	 l_binormal.w = 0;
	 float4x4 biasmat = {0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f};
	 l_slightcoord0 = mul(biasmat, mul(trans_model_to_clip_of_slight0, vtx_position));
}

void fshader(
	 in float4 l_hpos : TEXCOORD7,
	 in uniform float4 attr_fog,
	 in uniform float4 attr_fogcolor,
	 in float4 l_eye_position : TEXCOORD3,
	 in float4 l_eye_normal : TEXCOORD4,
	 uniform sampler2D tex_0,
	 in float4 l_texcoord0 : TEXCOORD0,
	 uniform sampler2D tex_1,
	 in float4 l_texcoord1 : TEXCOORD1,
	 uniform sampler2D tex_2,
	 in float4 l_texcoord2 : TEXCOORD2,
	 in float3 l_tangent : TEXCOORD5,
	 in float3 l_binormal : TEXCOORD6,
	 uniform float4 alight_alight0,
	 uniform float4x4 dlight_dlight0_rel_view,
	 uniform float4x4 slight_slight0_rel_view,
	 uniform float4   satten_slight0,
	 uniform sampler2DShadow k_slighttex0,
	 float4 l_slightcoord0,
	 uniform float4 row1_view_to_model,
	 out float4 o_color : COLOR0,
	 uniform float4 attr_color,
	 uniform float4 attr_colorscale
) {
	 float4 result;
	 // Fetch all textures.
	 float4 tex0 = tex2D(tex_0, l_texcoord0.xy);
	 float4 tex1 = tex2D(tex_1, l_texcoord1.xy);
	 float4 tex2 = tex2D(tex_2, l_texcoord2.xy);
	 // Translate tangent-space normal in map to view-space.
	 float3 tsnormal = ((float3)tex2 * 2) - 1;
	 l_eye_normal.xyz *= tsnormal.z;
	 l_eye_normal.xyz += l_tangent * tsnormal.x;
	 l_eye_normal.xyz += l_binormal * tsnormal.y;
	 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;
	 float lshad;
	 float4 tot_ambient = float4(0,0,0,0);
	 float4 tot_diffuse = float4(0,0,0,0);
	 float4 tot_specular = float4(0,0,0,0);
	 float shininess = 50; // no shininess specified, using default
	 // 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;
	 lhalf = dlight_dlight0_rel_view[3];
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // Spot Light 0
	 lcolor = slight_slight0_rel_view[0];
	 lspec  = slight_slight0_rel_view[1];
	 lpoint = slight_slight0_rel_view[2];
	 ldir   = slight_slight0_rel_view[3];
	 latten = satten_slight0;
	 lvec   = lpoint - l_eye_position;
	 ldist  = length(float3(lvec));
	 lvec /= ldist;
	 langle = saturate(dot(ldir.xyz, lvec.xyz));
	 lattenv = 1/(latten.x + latten.y*ldist + latten.z*ldist*ldist);
	 lattenv *= pow(langle, latten.w);
	 if (langle < ldir.w) lattenv = 0;
	 lcolor *= lattenv * saturate(dot(l_eye_normal.xyz, lvec.xyz));
	 lshad = shadow2DProj(k_slighttex0, l_slightcoord0).r;
	 lcolor *= lshad;
	 lspec *= lshad;
	 tot_diffuse += lcolor;
	 lhalf = normalize(lvec - float4(0,1,0,0));
	 lspec *= lattenv;
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // 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.a = 1;
	 result.rgba *= tex0;
	 result *= attr_colorscale;
	 tot_specular *= tex1.a;
	 result.rgb = result.rgb + tot_specular.rgb;
	 result.rgb = lerp(attr_fogcolor.rgb, result.rgb, saturate(exp2(attr_fog.x * attr_fog.x * l_hpos.z * l_hpos.z * -1.442695f)));
	 o_color = result * 1.000001;
}

genshader3:

//Cg
void vshader(
	 in float4 vtx_texcoord0 : TEXCOORD0,
	 out float4 l_texcoord0 : TEXCOORD0,
	 in float4 vtx_texcoord1 : TEXCOORD1,
	 out float4 l_texcoord1 : TEXCOORD1,
	 in float4 vtx_texcoord2 : TEXCOORD2,
	 out float4 l_texcoord2 : TEXCOORD2,
	 uniform float4x4 trans_model_to_view,
	 out float4 l_eye_position : TEXCOORD3,
	 uniform float4x4 tpose_view_to_model,
	 out float4 l_eye_normal : TEXCOORD4,
	 in float4 vtx_normal : TEXCOORD3,
	 in float4 vtx_tangent2 : TEXCOORD4,
	 in float4 vtx_binormal2 : TEXCOORD5,
	 out float4 l_tangent : TEXCOORD5,
	 out float4 l_binormal : TEXCOORD6,
	 uniform float4x4 trans_model_to_clip_of_slight0,
	 out float4 l_slightcoord0,
	 out float4 l_hpos : TEXCOORD7,
	 float4 vtx_position : POSITION,
	 out float4 l_position : POSITION,
	 uniform float4x4 mat_modelproj
) {
	 l_position = mul(mat_modelproj, vtx_position);
	 l_hpos = l_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;
	 l_texcoord0 = vtx_texcoord0;
	 l_texcoord1 = vtx_texcoord1;
	 l_texcoord2 = vtx_texcoord2;
	 l_tangent.xyz = mul((float3x3)tpose_view_to_model, vtx_tangent2.xyz);
	 l_tangent.w = 0;
	 l_binormal.xyz = mul((float3x3)tpose_view_to_model, -vtx_binormal2.xyz);
	 l_binormal.w = 0;
	 float4x4 biasmat = {0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f};
	 l_slightcoord0 = mul(biasmat, mul(trans_model_to_clip_of_slight0, vtx_position));
}

void fshader(
	 in float4 l_hpos : TEXCOORD7,
	 in uniform float4 attr_fog,
	 in uniform float4 attr_fogcolor,
	 in float4 l_eye_position : TEXCOORD3,
	 in float4 l_eye_normal : TEXCOORD4,
	 uniform sampler2D tex_0,
	 in float4 l_texcoord0 : TEXCOORD0,
	 uniform sampler2D tex_1,
	 in float4 l_texcoord1 : TEXCOORD1,
	 uniform sampler2D tex_2,
	 in float4 l_texcoord2 : TEXCOORD2,
	 in float3 l_tangent : TEXCOORD5,
	 in float3 l_binormal : TEXCOORD6,
	 uniform float4 alight_alight0,
	 uniform float4x4 dlight_dlight0_rel_view,
	 uniform float4x4 slight_slight0_rel_view,
	 uniform float4   satten_slight0,
	 uniform sampler2DShadow k_slighttex0,
	 float4 l_slightcoord0,
	 uniform float4 row1_view_to_model,
	 out float4 o_color : COLOR0,
	 uniform float4 attr_color,
	 uniform float4 attr_colorscale
) {
	 float4 result;
	 // Fetch all textures.
	 float4 tex0 = tex2D(tex_0, l_texcoord0.xy);
	 float4 tex1 = tex2D(tex_1, l_texcoord1.xy);
	 float4 tex2 = tex2D(tex_2, l_texcoord2.xy);
	 // Translate tangent-space normal in map to view-space.
	 float3 tsnormal = ((float3)tex2 * 2) - 1;
	 l_eye_normal.xyz *= tsnormal.z;
	 l_eye_normal.xyz += l_tangent * tsnormal.x;
	 l_eye_normal.xyz += l_binormal * tsnormal.y;
	 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;
	 float lshad;
	 float4 tot_ambient = float4(0,0,0,0);
	 float4 tot_diffuse = float4(0,0,0,0);
	 float4 tot_specular = float4(0,0,0,0);
	 float shininess = 50; // no shininess specified, using default
	 // 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;
	 lhalf = dlight_dlight0_rel_view[3];
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // Spot Light 0
	 lcolor = slight_slight0_rel_view[0];
	 lspec  = slight_slight0_rel_view[1];
	 lpoint = slight_slight0_rel_view[2];
	 ldir   = slight_slight0_rel_view[3];
	 latten = satten_slight0;
	 lvec   = lpoint - l_eye_position;
	 ldist  = length(float3(lvec));
	 lvec /= ldist;
	 langle = saturate(dot(ldir.xyz, lvec.xyz));
	 lattenv = 1/(latten.x + latten.y*ldist + latten.z*ldist*ldist);
	 lattenv *= pow(langle, latten.w);
	 if (langle < ldir.w) lattenv = 0;
	 lcolor *= lattenv * saturate(dot(l_eye_normal.xyz, lvec.xyz));
	 lshad = shadow2DProj(k_slighttex0, l_slightcoord0).r;
	 lcolor *= lshad;
	 lspec *= lshad;
	 tot_diffuse += lcolor;
	 lhalf = normalize(lvec - float4(0,1,0,0));
	 lspec *= lattenv;
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // 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 *= tex0;
	 result *= attr_colorscale;
	 tot_specular *= tex1.a;
	 result.rgb = result.rgb + tot_specular.rgb;
	 result.rgb = lerp(attr_fogcolor.rgb, result.rgb, saturate(exp2(attr_fog.x * attr_fog.x * l_hpos.z * l_hpos.z * -1.442695f)));
	 o_color = result * 1.000001;
}

genshader4:

//Cg
void vshader(
	 in float4 vtx_texcoord0 : TEXCOORD0,
	 out float4 l_texcoord0 : TEXCOORD0,
	 in float4 vtx_texcoord1 : TEXCOORD1,
	 out float4 l_texcoord1 : TEXCOORD1,
	 in float4 vtx_texcoord2 : TEXCOORD2,
	 out float4 l_texcoord2 : TEXCOORD2,
	 uniform float4x4 trans_model_to_view,
	 out float4 l_eye_position : TEXCOORD3,
	 uniform float4x4 tpose_view_to_model,
	 out float4 l_eye_normal : TEXCOORD4,
	 in float4 vtx_normal : TEXCOORD3,
	 in float4 vtx_tangent2 : TEXCOORD4,
	 in float4 vtx_binormal2 : TEXCOORD5,
	 out float4 l_tangent : TEXCOORD5,
	 out float4 l_binormal : TEXCOORD6,
	 uniform float4x4 trans_model_to_clip_of_slight0,
	 out float4 l_slightcoord0,
	 out float4 l_hpos : TEXCOORD7,
	 float4 vtx_position : POSITION,
	 out float4 l_position : POSITION,
	 uniform float4x4 mat_modelproj
) {
	 l_position = mul(mat_modelproj, vtx_position);
	 l_hpos = l_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;
	 l_texcoord0 = vtx_texcoord0;
	 l_texcoord1 = vtx_texcoord1;
	 l_texcoord2 = vtx_texcoord2;
	 l_tangent.xyz = mul((float3x3)tpose_view_to_model, vtx_tangent2.xyz);
	 l_tangent.w = 0;
	 l_binormal.xyz = mul((float3x3)tpose_view_to_model, -vtx_binormal2.xyz);
	 l_binormal.w = 0;
	 float4x4 biasmat = {0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f};
	 l_slightcoord0 = mul(biasmat, mul(trans_model_to_clip_of_slight0, vtx_position));
}

void fshader(
	 in float4 l_hpos : TEXCOORD7,
	 in uniform float4 attr_fog,
	 in uniform float4 attr_fogcolor,
	 in float4 l_eye_position : TEXCOORD3,
	 in float4 l_eye_normal : TEXCOORD4,
	 uniform sampler2D tex_0,
	 in float4 l_texcoord0 : TEXCOORD0,
	 uniform sampler2D tex_1,
	 in float4 l_texcoord1 : TEXCOORD1,
	 uniform sampler2D tex_2,
	 in float4 l_texcoord2 : TEXCOORD2,
	 in float3 l_tangent : TEXCOORD5,
	 in float3 l_binormal : TEXCOORD6,
	 uniform float4 alight_alight0,
	 uniform float4x4 dlight_dlight0_rel_view,
	 uniform float4x4 slight_slight0_rel_view,
	 uniform float4   satten_slight0,
	 uniform sampler2DShadow k_slighttex0,
	 float4 l_slightcoord0,
	 uniform float4 row1_view_to_model,
	 out float4 o_color : COLOR0,
	 uniform float4 attr_color,
	 uniform float4 attr_colorscale
) {
	 float4 result;
	 // Fetch all textures.
	 float4 tex0 = tex2D(tex_0, l_texcoord0.xy);
	 float4 tex1 = tex2D(tex_1, l_texcoord1.xy);
	 float4 tex2 = tex2D(tex_2, l_texcoord2.xy);
	 // Translate tangent-space normal in map to view-space.
	 float3 tsnormal = ((float3)tex2 * 2) - 1;
	 l_eye_normal.xyz *= tsnormal.z;
	 l_eye_normal.xyz += l_tangent * tsnormal.x;
	 l_eye_normal.xyz += l_binormal * tsnormal.y;
	 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;
	 float lshad;
	 float4 tot_ambient = float4(0,0,0,0);
	 float4 tot_diffuse = float4(0,0,0,0);
	 float4 tot_specular = float4(0,0,0,0);
	 float shininess = 50; // no shininess specified, using default
	 // 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;
	 lhalf = dlight_dlight0_rel_view[3];
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // Spot Light 0
	 lcolor = slight_slight0_rel_view[0];
	 lspec  = slight_slight0_rel_view[1];
	 lpoint = slight_slight0_rel_view[2];
	 ldir   = slight_slight0_rel_view[3];
	 latten = satten_slight0;
	 lvec   = lpoint - l_eye_position;
	 ldist  = length(float3(lvec));
	 lvec /= ldist;
	 langle = saturate(dot(ldir.xyz, lvec.xyz));
	 lattenv = 1/(latten.x + latten.y*ldist + latten.z*ldist*ldist);
	 lattenv *= pow(langle, latten.w);
	 if (langle < ldir.w) lattenv = 0;
	 lcolor *= lattenv * saturate(dot(l_eye_normal.xyz, lvec.xyz));
	 lshad = shadow2DProj(k_slighttex0, l_slightcoord0).r;
	 lcolor *= lshad;
	 lspec *= lshad;
	 tot_diffuse += lcolor;
	 lhalf = normalize(lvec - float4(0,1,0,0));
	 lspec *= lattenv;
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // 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 *= tex0;
	 result *= attr_colorscale;
	 tot_specular *= tex1.a;
	 result.rgb = result.rgb + tot_specular.rgb;
	 result.rgb = lerp(attr_fogcolor.rgb, result.rgb, saturate(exp2(attr_fog.x * attr_fog.x * l_hpos.z * l_hpos.z * -1.442695f)));
	 o_color = result * 1.000001;
}

genshader5:

//Cg
void vshader(
	 in float4 vtx_texcoord0 : TEXCOORD0,
	 out float4 l_texcoord0 : TEXCOORD0,
	 uniform float4x4 trans_model_to_view,
	 out float4 l_eye_position : TEXCOORD1,
	 uniform float4x4 tpose_view_to_model,
	 out float4 l_eye_normal : TEXCOORD2,
	 in float4 vtx_normal : TEXCOORD1,
	 out float4 l_hpos : TEXCOORD3,
	 float4 vtx_position : POSITION,
	 out float4 l_position : POSITION,
	 uniform float4x4 mat_modelproj
) {
	 l_position = mul(mat_modelproj, vtx_position);
	 l_hpos = l_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;
	 l_texcoord0 = vtx_texcoord0;
}

void fshader(
	 in float4 l_hpos : TEXCOORD3,
	 in uniform float4 attr_fog,
	 in uniform float4 attr_fogcolor,
	 in float4 l_eye_position : TEXCOORD1,
	 in float4 l_eye_normal : TEXCOORD2,
	 uniform sampler2D tex_0,
	 in float4 l_texcoord0 : TEXCOORD0,
	 uniform float4 alight_alight0,
	 out float4 o_color : COLOR0,
	 uniform float4 attr_color,
	 uniform float4 attr_colorscale
) {
	 float4 result;
	 // 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);
	 // Ambient Light 0
	 lcolor = alight_alight0;
	 tot_ambient += lcolor;
	 // Begin view-space light summation
	 result = float4(0,0,0,0);
	 result += tot_ambient * attr_color;
	 result = saturate(result);
	 // End view-space light calculations
	 result.a = attr_color.a;
	 result.rgba *= tex0;
	 result *= attr_colorscale;
	 result.rgb = lerp(attr_fogcolor.rgb, result.rgb, saturate(exp2(attr_fog.x * attr_fog.x * l_hpos.z * l_hpos.z * -1.442695f)));
	 o_color = result * 1.000001;
}

gensahder6:

//Cg
void vshader(
	 in float4 vtx_texcoord0 : TEXCOORD0,
	 out float4 l_texcoord0 : TEXCOORD0,
	 in float4 vtx_texcoord1 : TEXCOORD1,
	 out float4 l_texcoord1 : TEXCOORD1,
	 in float4 vtx_texcoord2 : TEXCOORD2,
	 out float4 l_texcoord2 : TEXCOORD2,
	 uniform float4x4 trans_model_to_view,
	 out float4 l_eye_position : TEXCOORD3,
	 uniform float4x4 tpose_view_to_model,
	 out float4 l_eye_normal : TEXCOORD4,
	 in float4 vtx_normal : TEXCOORD3,
	 in float4 vtx_tangent2 : TEXCOORD4,
	 in float4 vtx_binormal2 : TEXCOORD5,
	 out float4 l_tangent : TEXCOORD5,
	 out float4 l_binormal : TEXCOORD6,
	 uniform float4x4 trans_model_to_clip_of_slight0,
	 out float4 l_slightcoord0,
	 out float4 l_hpos : TEXCOORD7,
	 float4 vtx_position : POSITION,
	 out float4 l_position : POSITION,
	 uniform float4x4 mat_modelproj
) {
	 l_position = mul(mat_modelproj, vtx_position);
	 l_hpos = l_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;
	 l_texcoord0 = vtx_texcoord0;
	 l_texcoord1 = vtx_texcoord1;
	 l_texcoord2 = vtx_texcoord2;
	 l_tangent.xyz = mul((float3x3)tpose_view_to_model, vtx_tangent2.xyz);
	 l_tangent.w = 0;
	 l_binormal.xyz = mul((float3x3)tpose_view_to_model, -vtx_binormal2.xyz);
	 l_binormal.w = 0;
	 float4x4 biasmat = {0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f};
	 l_slightcoord0 = mul(biasmat, mul(trans_model_to_clip_of_slight0, vtx_position));
}

void fshader(
	 in float4 l_hpos : TEXCOORD7,
	 in uniform float4 attr_fog,
	 in uniform float4 attr_fogcolor,
	 in float4 l_eye_position : TEXCOORD3,
	 in float4 l_eye_normal : TEXCOORD4,
	 uniform sampler2D tex_0,
	 in float4 l_texcoord0 : TEXCOORD0,
	 uniform sampler2D tex_1,
	 in float4 l_texcoord1 : TEXCOORD1,
	 uniform sampler2D tex_2,
	 in float4 l_texcoord2 : TEXCOORD2,
	 in float3 l_tangent : TEXCOORD5,
	 in float3 l_binormal : TEXCOORD6,
	 uniform float4 alight_alight0,
	 uniform float4x4 dlight_dlight0_rel_view,
	 uniform float4x4 slight_slight0_rel_view,
	 uniform float4   satten_slight0,
	 uniform sampler2DShadow k_slighttex0,
	 float4 l_slightcoord0,
	 uniform float4 row1_view_to_model,
	 out float4 o_color : COLOR0,
	 uniform float4 attr_color,
	 uniform float4 attr_colorscale
) {
	 float4 result;
	 // Fetch all textures.
	 float4 tex0 = tex2D(tex_0, l_texcoord0.xy);
	 float4 tex1 = tex2D(tex_1, l_texcoord1.xy);
	 float4 tex2 = tex2D(tex_2, l_texcoord2.xy);
	 // Translate tangent-space normal in map to view-space.
	 float3 tsnormal = ((float3)tex2 * 2) - 1;
	 l_eye_normal.xyz *= tsnormal.z;
	 l_eye_normal.xyz += l_tangent * tsnormal.x;
	 l_eye_normal.xyz += l_binormal * tsnormal.y;
	 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;
	 float lshad;
	 float4 tot_ambient = float4(0,0,0,0);
	 float4 tot_diffuse = float4(0,0,0,0);
	 float4 tot_specular = float4(0,0,0,0);
	 float shininess = 50; // no shininess specified, using default
	 // 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;
	 lhalf = dlight_dlight0_rel_view[3];
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // Spot Light 0
	 lcolor = slight_slight0_rel_view[0];
	 lspec  = slight_slight0_rel_view[1];
	 lpoint = slight_slight0_rel_view[2];
	 ldir   = slight_slight0_rel_view[3];
	 latten = satten_slight0;
	 lvec   = lpoint - l_eye_position;
	 ldist  = length(float3(lvec));
	 lvec /= ldist;
	 langle = saturate(dot(ldir.xyz, lvec.xyz));
	 lattenv = 1/(latten.x + latten.y*ldist + latten.z*ldist*ldist);
	 lattenv *= pow(langle, latten.w);
	 if (langle < ldir.w) lattenv = 0;
	 lcolor *= lattenv * saturate(dot(l_eye_normal.xyz, lvec.xyz));
	 lshad = shadow2DProj(k_slighttex0, l_slightcoord0).r;
	 lcolor *= lshad;
	 lspec *= lshad;
	 tot_diffuse += lcolor;
	 lhalf = normalize(lvec - float4(0,1,0,0));
	 lspec *= lattenv;
	 lspec *= pow(saturate(dot(l_eye_normal.xyz, lhalf.xyz)), shininess);
	 tot_specular += lspec;
	 // 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.a = 1;
	 result.rgba *= tex0;
	 result *= attr_colorscale;
	 tot_specular *= tex1.a;
	 result.rgb = result.rgb + tot_specular.rgb;
	 result.rgb = lerp(attr_fogcolor.rgb, result.rgb, saturate(exp2(attr_fog.x * attr_fog.x * l_hpos.z * l_hpos.z * -1.442695f)));
	 o_color = result * 1.000001;
}

That’s a lot-o-shaders. Should I post the shaders from 7 to 26?

Just an update on my issue - if I remove the shine or normal texture from my models it all works fine.

I checked in something that may fix the issue. Can you try the latest buildbot build?

The latest buildbot (Panda3D-2012.01.16-449)throws an error at me:

Traceback (most recent call last):
  File "main2.py", line 15, in <module>
    from panda3d.core import *
  File "C:\Panda3D-1.8.0\panda3d.py", line 193, in __getattr__
    for obj in dir(self.__manager__.libimport(lib)):
  File "C:\Panda3D-1.8.0\panda3d.py", line 128, in libimport
    return cls.imp.load_dynamic(name, target)
ImportError: DLL load failed with error code -1073741795

Today’s build also doesn’t want to work. Not even pview… Should I write a bug report?

Sorry for the delay, I’ve been busy with other tasks.
I forced a clean build, can you try the latest buildbot version? Thanks!

Just tried 2012.01.22-456, but I still get the same. Pview ends with an exeption, panda programs won’t run.
Typing into the interpreter “import direct.directbase.DirectStart” gave me this:

>>> import direct.directbase.DirectStart
DirectStart: Starting the game.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Panda3D-1.8.0\direct\directbase\DirectStart.py", line 3, in <module>
    from direct.showbase import ShowBase
  File "C:\Panda3D-1.8.0\direct\showbase\ShowBase.py", line 10, in <module>
    from pandac.PandaModules import *
  File "C:\Panda3D-1.8.0\pandac\PandaModules.py", line 2, in <module>
    from libpandaexpressModules import *
  File "C:\Panda3D-1.8.0\pandac\libpandaexpressModules.py", line 1, in <module>
    from extension_native_helpers import *
  File "C:\Panda3D-1.8.0\pandac\extension_native_helpers.py", line 81, in <modul
e>
    Dtool_PreloadDLL("libpandaexpress")
  File "C:\Panda3D-1.8.0\pandac\extension_native_helpers.py", line 79, in Dtool_
PreloadDLL
    imp.load_dynamic(module, pathname)
ImportError: DLL load failed with error code -1073741795

from panda3d.core import * give exactly the same output as two post above.

Tomorrow I can try to install the same build on two different machines (one running Vista the other W7) and see what happens.

Maybe something to do with the experimental librocket wrapper?

@redpanda: No, libRocket has nothing to do with it. The problem occurs when importing DirectStart, according to wezu.

@wezu: I am having no issues with the latest Windows buildbot build. I can import DirectStart without a problem. Perhaps you still accidentally have an old build with conflicting libraries?

Sorry, but I think wezu is saying he gets the same problem when importing panda3d.core as few posts above.

And the new error message seems to be caused because DirectStart imports ShowBase, which itself imports the PandaModules.

I’ll try a buildbot version myself and see if I get the same.