performance issue (repeat + randoms)


I face huge performance issues while handling the attached automn_river.sifz file. Turning the working rendering quality to extremely low does not help, so I’d like to try to simplify the used formulas.

The effect I want to achieve is a background of leaves (single leaf available in leaf_mapple.sifz), with various orientations, colors and sizes… something similar to a “brush” in The Gimp or Photoshop.

To get the result automn_river.png I tried various combinations of Add and Random, leading to something that requires huge resources… any hint on achieving similar result more easily is really welcome.

My current layers tree looks like:

Rotate [Amount: -15°]
  | Duplicate [from:1 to:25 step:0.2]  (exports Index)
  | Color Correct [Hue: Add: -20° + (2° x Index)]
  | Inline Canvas
  |  - Zoom: Random [Seed: 12706 + (1 x Index)]  [Animation Speed: 0]  [Radius: 0.6]
  |  - Origin: Composite: (X: Random [Seed:12705 + (1 x Index)] [Animation Speed: 0])  (Y: Random [Seed:12704 + (1 x Index)] [Animation Speed: 0])
  |  | Rotate [Amount: Add: 8° + (12° x Index)]
  |  | Import [leaf_mapple.sifz] [Zoom: -3.0]

I’m pretty sure my use of Randoms is at sake: changing the seed just seems wrong. I could maybe use Sine or Range… but did not succeed up to now.

Ideally I’d like to get 300+ leaves, with Color Correct Hue varying from [-20;+50], Orientation from [0°;120°], Size [0;0.5] and location seemingly random in top half of display.

Any hint would be appreciated.
Have a nice day!

automn_river.sifz (1.48 KB)

leaf_mapple.sifz (4.79 KB)

bereth, I’ll try to look for an alternative for the same effect when I have a little more time. Please bump the thread to remind me it is pending.

Try exporting leaf_maple.sifz as a png file, and import the png instead. Does it make a difference?

Yes it makes a huge difference in performance, both for editing and rendering. I can use the same layer + formulas tree as above with a repeated png leaf and repeat it from 1 to 25 (step 0.1), i.e. ~250 leaves. So thanks for the fix.

Nevertheless this hinders the quality of the final rendering (as png is no vector format), because I apply a zoom effect on each repeated element (leaf)… so any other idea is still welcome!


2 examples “made with Synfig” attached, for illustration. next improvement needed: random the Z index to mix the leaves of different colors in height… but I definitely don’t want to add one more random… for performance issue. any suggestion?

I’m always running into performance issues, the way I work around it is to make two versions of each layer, one with details for rendering and one with only outlines and regions for animating (simple colours, no blurs or anything) (and make sure everything is linked). Then you need to switch the detailed version on and the plain version off when you’re ready to render. And it helps to render it from the command line

Pre-rendering a png file makes things quicker, and if you make it large enough it looks okay in the render - or you can turn the raster version off and vector version on at render time

Hopefully we’ll get this opengl version someday and it will run a lot faster
leaf_mapple.sifz (4.91 KB)

Didn’t thought about using links in this way. nice tip, thanks.