Hey everyone! I’ve got another issue that needs fixing!
I’ve been trying to find a way to do a cheap and easy water effect for my game. I discovered that you could create a rather nice effect simply by placing two watery textures over one another and moving the top one in a particular direction.
My problem is that it’s really slow. My frame rate drops from 60(I have vsync on) to 30 when I do that. So I get an incredible lost of performance. My PC is built to be a gaming PC with a quad core processor and a ATI Radeon HD 5750.
I don’t know a lot about messing with textures in Panda3D so if anyone could help me out here that’d be great! I’d be willing to go with a different water effect too if anyone knows of any that is relatively easy to implement.
It’s true that running a task that changes the state every frame is very expensive when used in conjunction with the shader generator, because it means a new shader must be compiled and generated every frame. If you have a custom shader, or if you use the fixed-function pipeline (shader generator off) on your particular node, you should have no problems.
Ah yeah indeed it was the shaders. Also what I thought was moving the textures over one another was actually the shaders making the water effect I liked! …I’m sort of not very good at being able to tell the difference apparently! :X
Though after tweaking with it some more I was able to get it to look pretty good doing the method I originally described.
Correct I was only moving the UV. I originally was being kind of stupid and thought I was getting the effect I was because I was moving the UV of the top texture over a lower texture but didn’t realize it was actually the shaders I was seeing making the effect.
The screenshots show it after I did some tweaking. There isn’t a huge difference now, so my original idea did work.
There isn’t a huge difference. I think you kind of see that the shaders give it more of a wavy appearance when it’s moving but other then that I think it looks pretty good either way.
What effect are we talking about here? You should have the same effect without the shader generator. Are you talking about the texture animation? I cant tell much from your images, looks like one just isnt so bright because you disabled lightning.
The shader generator changed the surface of the water somewhat, and that is all that has been disabled.
There is still a light shining on the water surface, that has not been disabled.
All I have disabled is this…
Disabling that is all I needed to get my frame rates back up. But I do see a pretty big difference and I some what liked what I saw with that on.
I have a video here that shows the difference. Maybe the you guys won’t think much of the difference I don’t know. The first part shows it without the shaders and the second part shows it with the shaders.