FilterManager issues

I encounters two problems in using the filter manager.

First, I find that if the screen has particle effects, the console output this:
:pgraph(error): Shader Generator does not support TexMatrix yet.
All the particle becomes dark. The fps dropped to below 10.

Second, the screen output become smaller and shift to the lower left. It looks like a texture padding problem.

I search around and only find one solution handled in the vshader:

l_texcoord0 = vtx_position.xz * texpad_tex0.xy + texpad_tex0.xy;

instead of
l_texcoord0=vtx_texcoord0;

I would like to know if it is the right/only way to handle it ?
Thank you.

Make sure you’re not enabling the shader generator, then.

That’s because Panda resizes textures to a power-of-two scale. You handled it correctly in the shader by using texpad. This is how CommonFilters does it:

text += " l_texcoordC=(vtx_position.xzxz * texpad_txcolor) + texpad_txcolor;\n"

Make sure you’re not enabling the shader generator, then.

Do you mean setShaderAuto ? I have not called it.

Which version of Panda are you using? I do know that older versions of Panda had FilterManager enabling the shader generator.

Anyways, you should be able to override it like this:

render.setShaderOff(2)

I still at 1.5.4.

It is fixed by your recommendation. Can you tell me why and how is this call fix the problem ?

Well, internally, something called setShaderAuto (which is the same as setShaderAuto(0)).

By calling setShaderOff(1), you’re applying a ShaderAttrib thats “off” to the nodepath with a higher override value than the setShaderAuto, so it will override the “auto” shader state with an “off” shader state.

Note that setShaderOff is something entirely different than clearShader. clearShader will remove any shader attrib on the current node, while setShaderOff adds a ShaderAttrib to the node with an “Off” state.