help with error

I recently created a folder called ‘game’ in the Panda3D-1.5.2 directory. I then packed my useful files from the folder I used before (called ‘projects’) into the game folder. I had ran the soft shadows demo from the ‘projects’ folder before, and it worked. Now when I ran it from the ‘game’ folder, I get this error:

Assertion failed: Shader input scale is not present.
at line 323 of c:\temp\mkpr\panda\src\pgraph\shaderAttrib.cxx
Traceback (most recent call last):
File “”, line 8899, in
run( )
File “C:\Panda3D-1.5.2\direct\src\showbase\”, line 2262, in run
File “C:\Panda3D-1.5.2\direct\src\task\”, line 939, in run
File “C:\Panda3D-1.5.2\direct\src\task\”, line 877, in step
File “C:\Panda3D-1.5.2\direct\src\task\”, line 776, in __stepThroughList
ret = self.__executeTask(task)
File “C:\Panda3D-1.5.2\direct\src\task\”, line 696, in __executeTask
ret = task(*task.extraArgs)
File “C:\Panda3D-1.5.2\direct\src\showbase\”, line 1522, in __igLoop
AssertionError: Shader input scale is not present.
at line 323 of c:\temp\mkpr\panda\src\pgraph\shaderAttrib.cxx
:display:gsg:glgsg(error): at 2637 of c:\temp\mkpr\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : GL error 1282

You obviously forgot to set the shader input “scale” somewhere in the code where you actually are using “k_scale” in the shader.

Me? Not me. I haven’t touched the code. All I did was copy files to a different folder. Anyhow, I looked for this k_scale and found it in the caster shader, but I know nothing about writing shaders. This is the code:


void vshader(float4 vtx_position : POSITION,
             uniform float4x4 mat_modelproj,
             uniform float4 k_scale,
	     out float4 l_position : POSITION,
             out float4 l_pos : TEXCOORD0
  float4 position = vtx_position * k_scale;
  l_pos = mul(mat_modelproj, position);
  l_position = l_pos;

void fshader(in float4 l_pos : TEXCOORD0,
             out float4 o_color:COLOR)
  float z = (l_pos.z / l_pos.w) * 0.5 + 0.5;
  o_color = float4(z,z,z,1);

Is everything here correct? Thanks

Wait a minute… Are you talking about the shader code, or the shadows demo code, in this area:

    # Set the shader inputs
    self.scene.setShaderInput("light", self.light)
    self.scene.setShaderInput("depthmap", blurYBuffer.getTexture())
    self.scene.setShaderInput("props", ambient, hardness, 0, 1)

Ahah. You’ve copied a wrong caster.sha. The caster.sha that comes with the soft shadow demo doesn’t use k_scale at all. So the wrong file gets loaded.

Wow! You’re fast!
I copied this:
into the shadowManager code, and it worked. Thanks for the help.

Could you help me out with this error? I don’t know if I got something mixed up here also.

self.sMgr = ShadowManager(render)
File “C:\Panda3D-1.5.2\samples\Shadows\”, line 99, in init
TypeError: NodePath.setShader() argument 1 must be Shader, not NoneType

looks like the file softshadow.sha couldn’t be found.
be sure to give it the correct path.

You’re right! I am almost certain I had the file there.
I’m probably getting too old for this. I’m losing it. Thanks