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 “main.py”, line 8899, in
run( )
File “C:\Panda3D-1.5.2\direct\src\showbase\ShowBase.py”, line 2262, in run
self.taskMgr.run()
File “C:\Panda3D-1.5.2\direct\src\task\Task.py”, line 939, in run
self.step()
File “C:\Panda3D-1.5.2\direct\src\task\Task.py”, line 877, in step
self.__stepThroughList(taskPriList)
File “C:\Panda3D-1.5.2\direct\src\task\Task.py”, line 776, in __stepThroughList
ret = self.__executeTask(task)
File “C:\Panda3D-1.5.2\direct\src\task\Task.py”, line 696, in __executeTask
ret = task(*task.extraArgs)
File “C:\Panda3D-1.5.2\direct\src\showbase\ShowBase.py”, line 1522, in __igLoop
self.graphicsEngine.renderFrame()
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:

//Cg

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

EDIT
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:
render.setShaderInput(‘scale’,1,1,1,1)
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\shadowManager.py”, line 99, in init
mci.setShader(loader.loadShader(“softshadow.sha”))
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