I have no more than 4 fps. What am I doing wrong?
You demand too much of your hardware. Even in "Rage" or "Battlefield" or "Skyrim" and the like, you will never ever see 1000 objects of 4096x4096 with a texture of the same size. It's just not the way it's working.
interesting. I'm getting about 15fps with the sine behavior on all of them, and about 30 without it. I have no idea why one png would render slower than another, especially that much slower, but perhaps one of the more knowledgeable folk around here can enlighten us.I'm getting 15 fps, too. It's not a matter of png rendering (the textures are on the graphic card's VRAM in a simple RGBA format, no png/jpg/etc anymore), it's a matter of different test settings. A graphic card has much more work to do if the viewport is larger. If you just half the width of the window from 1280 to 640, you will see that the framerate will instantly go up. Also, the hardware may differ. While my GTX460 Hawk is relatively powerful, a GT7600 is not. This will also result in different framerates.
In any case, even 30 fps with a workload that insanely exaggerated proves the point that there's more than enough power if you take the time to learn how to use it. You should never design a game that way with 1000 4096x4096 sprites on screen, this isn't just in construct.Absolutely correct. And it is a point that was explained some hundred times before now: If you try to use your hardware in a way it isn't designed for, you won't get what you want.
As far as 5 shaders and it's contribution to slowdown, I don't know much about them, but I suspect the games that look great use more complex shaders, not necessarily more shaders. CC is limited to PS2.0, perhaps this isn't what you'd want, but I'd suspect most 2d titles, including AAA titles don't have multiple shaders running at all times.That's correct as well. Most games (incl. AAA) will make use of 1 post process effect, that may run at all times. All other effects are placed carefully and the design of the game will factor in the use of effects, so that the amount is always as low as possible.
Some general informations:
1) Pixel shader
A pixel shader is an algorithm that runs on the gpu side and calulates every pixel it gets passed. Modern cards have shader units. They do whatever task is needed, vertex, pixel, even other tasks. The more units you use, the less gpu power for all the rest of the work, that needs to be done.
If you use a pixel shader on a 4k texture, then that shader calculates 4096x4096 = 16.7 million pixels per tick. That's 1 billion pixel calculations per second at 60fps. Now do this on 1000 4k textures and you have a quadrillion of pixel calculations per second, just for one pixel shader!
Of course, that's not the way, shaders are used. Instead, in 3D games, low res copies of a hires texture are made. For example, the hero may have a 4k helmet texture. But currently on screen that helmet is seen from a distance, so that it's only a couple of pixels big. Instead of the 4k texture, a 128x128 copy is used and sent to the pixel shader. You don't see the difference as it is so small, but the graphic card now only needs to do 0.9 million pixel calculations per second, instead of 1 billion.
In CC you should adapt that technique. For example, if you do a color correction on a 4k texture, but your game window is only 1280x720, then you are wasting processor power. Instead, attach the shader to a layer. The shader will now calculate the visible 1280x720 pixels and not the full 4k texture.
Also shaders should be deactivated, if their effect is not to be seen. For example, if two sprites lay one over the other, so that the lower one is completely covered, you don't need the pixel shader applied to it.
I'm sure there are many other optimizations I'm currently not thinking of, but the simple message is: Think smart, when designing your game.
2) Texture sizes
There are many, many cards out there, that are still optimized for lower res textures, like 512 or 1024. They do support 4k textures, but have a hard time with them. Consider that, when designing your game. Also, even backgrounds are not just one huge texture but composed out of many smaller ones. Have a look at this image: Whispered World
It is not one huge texture, but at least a dozen of smaller ones, carefully layered. You have to adapt your idea to the technique you use. If you are working with 3D optimized hardware, you need to split your creations into smaller textures and compose the game's graphics from them.