projected textures and shader generator

When I have a single projected texture on a model with shader generator enabled the framerate drops to non realtime.
Thats when nothing else is happening.
panda3d.org/manual/index.php … d_Textures
try with the code from the above page by enabling the shader generator on the ripple.

I use projected textures for flashlights and underwater caustics, but I want at least per-pixel lightning.

Is this maybe a bug?

Let’s call it a known limitation for now. This happens because of the way the TexProjectorEffect changes the state every frame, which causes the auto-shader to regenerate a new shader every frame. It might be possible in the future to avoid this–and we’re talking about ways to make this happen for Panda3D 2.0–but for now, it’s very difficult to fix.

David

Thats around 2012? :slight_smile:
I cant think of another way of doing a scene with 8 flashlights.
As for underwater caustics, I had another idea: multitexturing.
I apply the caustic texture (white and transparency) to my Actor and ocean floor. Combine mode is MDecal. On the actor custom uv is generated for the texturestage with TexGenAttrib.MWorldPosition. I animate the texOffset with a function lerp interval. Looks fine. But again when shaderGenerator is enabled the framerate drops to non realtime (its fine without animation).
Is this maybe the same issue? If it is as much as I hate to admit i might need to use another engine…

Yes, it’s the same issue.

The workaround is to write your own shader, rather than relying on the auto-shader. The limitation is in the auto-shader generator, not in Panda itself.

If you lack the experience necessary to write your own shader, you could try to dump out the text contents of the generated shader, save it to a file, then load it as a custom shader.

David

Can you use small led flashlights ? Please make me clear if I wrong in this fact.