setShaderInput for a constant table

I have a constant table (256 float values) stored a noise function for the shader to generate some random effects. What are the available ways to pass this table to the shader effectively ?

It seems array passing is not supported in setShaderInput. If I pass it through a texture, how the shader code address it precisely ?

Just have a thought, to generate the table in Cg format and combine with the original shader to make the final shader.
Any other advice ?

In addition to the first question, I would like to create a normal map texture on the python side, which will be affected by some user actions, and this normal map will be sent to a shader in each frame. What functions can I use to manipulate the texture at pixel level and send it to a shader effectively ?

Usually, this is done by passing a noise texture to the shader.

If the noise function is not static, how can I do it effectively in Panda ? I would like to modify the noise texture on the fly and send it regularly to the shader. What are the functions available to do these ?

Well, it’s possible to send an animated texture. However, I rather recommend passing a salt to the shader that offsets the pixel that’s being read from the static noise texture.

I have made the situation confusing. May be I should re-state what I want to do.

I would like to create a normal map on the panda side. This normal map will be changed dynamically according to some user input (e.g. some dragging a mouse). The shader side will need this updated normal map to render the scene.

  1. How can I modify a texture dynamically (after it is loaded to panda) ? Is there any efficient api I can use ? I can modify a png through other api dynamically but reload to panda regularly may not be efficient enough.

  2. How can I send this updated normal map to a shader efficiently, (this normal map may be changed every frame) ?

  1. Using the PNMImage and PNMPainter classes. You can find information about this on the manual and API reference.
  2. Just use setTexture or setShaderInput once. When you modify the texture, you don’t need to re-set the texture (or shader input), that will work automatically. You only need to call setTexture or setShaderInput again when you’ve replaced the texture by a different one, not if you just modified it.