I discovered a strange increase in fps performance after I copied and pasted the code from the soft particle example (lines 95-98) and later removed it but inadvertently left in
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
TranslucentBucketFilter tbf = new TranslucentBucketFilter(true);
in simpleInitApp(). I am working on using a bunch of quads to give the illusion of volumetric clouds and since the performance difference is definitely not insignificant, I’d like to understand why the above code affects performance even though I’m not using any translucent objects nor any soft particles.
Given that the code isn’t really doing anything if you aren’t using the translucent bucket, it’s easy to be skeptical that something else isn’t going on… especially when we can’t see anything else.
Also, how many times did you test one versus the other? How consistent are the frame rates? etc. I’ve seen that much swing before just when my GPU is overheating… makes timing things lots of fun. See something slow. Make a bunch of changes, recompile, fix syntax errors, recompile, run again (GPU has cooled down) get an extra 100+ FPS. Eureka! think I’ve discovered something only to find I haven’t.
So, we probably need more information.
Edit: also given that the two views are clearly different. Something has changed from one to the other. Make sure you use consistent randomness so that the view is the same every time.
I’ve cut down my code to its bare components and found that those four lines and the drawing of the quads are the only things that affect the performance. The performance difference is very consistent (except for when I force Java to use integrated graphics: then both get 29 fps); I’ve tried running one right after the other, running them with the computer under various loads, and comparing them both the computer’s startup and after hours of computer use. I removed the randomness and got the same results (though performance diminished for both, the difference is still there):
I’m looking for all of the differences between the two pictures. If the number of quads rendered is the same then that’s not a difference and doesn’t affect the performance difference between those two images.
…and the stats indicate that the triangle count is the same. I just wanted to make sure that there wasn’t any other difference.
Update: other filters have a similar fps boost effect.
and TranslucentBucketFilter increase the performance the most (but only when used individually), while other filters like BloomFilter and CartoonEdgeFilter have a higher fps than without any filters at all… strange!
P.S. this is a great learning experience for me: I had never used WaterFilter before and it looks good
Standard particle emitter doesn’t sort particles, and they are rendered with no depth test so there is a lot of overdraw.
With soft particles enabled, a sort of depth test is performed in the shader and irrelevant pixels are discarded, which dramatically reduce overdraw.
This only stands if depth write is enabled for the particles though, and I can’t remember if it’s the case by default. Also I guess the transparent nature of the particles kind of defeat that argument… Really…that’s strange…