I have a cloud object that has the brightness, grayscale and luminosity effects. All the object instances are in the same layer. I have a day/night cycle and weather states that affect the effects same way equally to all instances (meaning that I could potentially use the effect in the layer instead of the object) but I also have set up conditions that affect some instance effect levels individually (clouds get individually more grayscaly as they move in distance and get a brightness flash with lightning etc.).
So I could apply many of the effects' intensity levels to the objects' layer, but I couldn't replace the object's effects completely this way. would it still likely improve performance? I read in performance tips that you should render same effects in the same layer, I'm not sure how that applies in this case.
Develop games in your browser. Powerful, performant & highly capable.
I do believe putting the effect on the layer will have a performance benefit.
You could easily test it by adding 1000 objects with the effect to a layer and comparing it with an effect on a layer afterwards. You can check the fps and the cpu utilisation in the debugger. In other words just compare different extreme scenario's.
Furthermore, it's also more practical to only adjust the properties of a single layer as opposed to different objects of course.
Yes, doing a quick test with 1000 instances that have brightness and grayscale effects on vs their layer having the effects and changing the effect parameter value randomly every tick shows that using effects on layers is significantly faster.