Shader-less Shadows

Any idea when a patch will be released?

For multi levels I never actualy use a model with different floors, I simply load a lower or higher floor when the player gets on the elevator, ect.

looks very nice, but is indeed very slow (7 fps) on my machine.

Mac OSX 10.6, Panda 1.7.1

Probably not until Panda3D 2.0, unfortunately (which is in the works). This is actually a difficult bug to fix with the current design.

David

Well, from the development speed of panda3d, it could be a long time, so you should try to assign the shader yourself.

I was thinking of some method like disableShaderUpdate() which would do a very hacky thing: dump the shader itself and assign it to the node.

We could do it ourselves, but we would need to set all the shader imputs, which would still require knowledge of shaders to know what the shader accepts. And I don’t even know if shadergenerator stuff defined in the egg file (such as normalMaps) would work at all.

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;
}

Awww, this doesn’t work for me. Just like with the Shadow samples…

It loads, but at a very low frame rate (3.5 FPS).
Also, there are no shadows or lighting.

In case it helps, I’m using Panda 1.7.1 on Ubuntu 10.04, with an Intel GM45 GPU.

Anyone else had this problem?

The problem is your graphics card. I cant believe it will run at all on a GM45.

:frowning::cry:

Ah well…
Time to get a new PC! :smiley:

On a more serious note, why not?