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);
fpp.addFilter(tbf);
viewPort.addProcessor(fpp);
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):
Well, thanks for testing it consistently. Itās very strange.
ā¦maybe we should all be adding the magic filter to our code.
What does āand the drawing of the quadsā part mean? You mean when you changed from random to consistent or is there another difference than the four lines in the two images?
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.
ColorOverlayFilter,
ComposeFilter,
FadeFilter,
PssmShadowFilter,
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ā¦
EDItā¦ok didnāt read all the posts⦠So it was AAā¦