emme |
Ok, so I was just writing a post about integrating the bitmap-caching settings to the existing bitmap-components, but then I realized it's already there. Maybe this Was added in the latest patch, or maybe I was just blind and didn't realize it earlier. Great.
So it looks like only the internal bitmap operations are calculated at the caching resolution and not the whole thing. I was expecting the entire processing to be done at lowered resolution. I wonder how this works internally..? This is probably still work in progress - are you expecting to get more speed advantages from this? At the moment there doesn't seem to be much speed difference even between 100% and 3.125%. Does seem to be more memory efficient though. The new bitmap-cache component also doesn't seem to work well with other bitmap-components. Would be great if it would simply tell the preceding bitmap-component to re-apply its caching configuration, instead of re-caching the cache (or whatever it does, which seems to be very slow and memory intensive). Ideally how I imagine the bitmap-cache working at 50% resolution is that everything before it gets effectively processed at 1/4 the sample count and then cached. I'm sure there's some overhead and stuff to slow things down. Still, hoping we can get a significant speed advantage with this. This is good progress with a lot of potential ![]() |
|||||||
Posted: July 28, 2020 1:29 pm | ||||||||
Rachel Duim
![]() |
So far my experience with the cache has been good. Recursive bitmap filters are helped greatly by this. Another plus, you can turn off post anti-aliasing and control it yourself (see attached image). This example is in a code group for shadows. Since the "petal" is going to be repeated, anti-aliasing this one is good enough. You can also put anti-aliasing code & controls into your filters.
![]() Math meets art meets psychedelia. |
|||||||
Posted: July 28, 2020 7:12 pm | ||||||||
emme |
Yes, to be clear, I'm really happy with the bitmap-caching in general. I've already been able to reduce rendering times to 1/4 on some filters.
My original post was more about some specific areas, where the caching doesn't seem to work as well as expected. Mainly that lowering the caching resolution shows little to no performance boost in some cases, or even slows things down. It could well be that my initial testing setup was too simple and producing misleading results. Testing with more complex networks has shown better performance. I'll continue testing. |
|||||||
Posted: July 28, 2020 8:49 pm | ||||||||
Rachel Duim
![]() |
Caching is a fine art. I am not surprised that some cases are not helped or even made worse, I've seen this happen before in other code I've worked on. But I don't have a handle on the caching resolution. For now I'm gonna stick with 100% unless there is a good reason not to.
Math meets art meets psychedelia. |
|||||||
Posted: July 28, 2020 9:44 pm | ||||||||
GMM
Moderator
Posts: 3491 |
This is not the case where any additional cache would speed things up. This is a bitmap cache, and adding bitmaps into a procedural pipeline is more likely to slow the process rather than speed it up. You should always check filter performance with and without the cache, and generally prefer fully procedural rendering.
As far as I understand (could be wrong though), it's just the opposite. Everything is sampled at full size and then the bitmap is resized, so the benefit applies to components after the cache, not before it. |
|||||||
Posted: July 29, 2020 4:47 am | ||||||||
emme |
GMM, I'm pretty sure you're wrong
![]() The subtree certainly seems to be sampled at lower resolution, when the cache resolution is lowered. This is suggested both by rendering speed and the change in rendering block size. I don't think it would make sense to sample at full resolution and only downscale the bitmap. Still, I'm getting very inconsistent speeds. My current guess is that the (relative) change in rendering block size can sometimes make individual blocks less efficient. At lower image resolutions (very low rendering block count) this could sometimes make rendering slower even when the total sample count would be lower. Haven't done enough testing to confirm it yet. Any chance the devs could give some technical info on this? Thanks. |
|||||||
Posted: July 29, 2020 8:59 am | ||||||||
Vladimir Golovin
Administrator |
This is because the subtree you're plugging into the Bitmap Cache is fast enough. You will get the maximum speed advantage when 1) the Bitmap Cache subtree is slow to render, 2) the cache resolution is lower than 100%, and 3) the Bitmap Cache component is connected to multiple inputs.
This is probably due to our cache reuse mechanic. When the output of a bitmap-based component is plugged into a bitmap-cached input, the input doesn't re-render the cache, but instead reuses the output cache of the connected component as its own input cache. A corollary: cache settings for the bitmap-cached input will be ignored in this situation.
It works exactly as you describe. 100% means 1x sample count, 50% means 1/4 sample count, 25% means 1/16 sample count etc. Note that the sample counts are impacted by the Anti-Aliasing settings of the input. |
|||||||
Posted: July 30, 2020 5:08 am | ||||||||
Vladimir Golovin
Administrator |
Here's a tip: if you're using a blur with a relatively large radius on a heavy procedural subtree, you can safely set resolution to 50% or even lower. |
|||||||
Posted: July 30, 2020 5:09 am | ||||||||
Vladimir Golovin
Administrator |
Of course not ![]() |
|||||||
Posted: July 30, 2020 5:10 am | ||||||||
Vladimir Golovin
Administrator |
In general, Bitmap Cache is not a magic "give me speed" button. When you're caching a fast subtree, you may actually lose speed because memory access isn't cheap, especially with bicubic filtering, which requires 16 pixel fetch operations (as opposed to 4 of bilinear or 1 of no filtering).
|
|||||||
Posted: July 30, 2020 5:46 am | ||||||||
emme |
This is all good to hear. Makes sense. Thanks Vladimir
![]() |
|||||||
Posted: July 30, 2020 9:18 am | ||||||||
Sphinx.
![]() |
Juicy ![]() I.e. consider this chain of bitmap components: A -> B -> C A creates the cache, do its thing and passes on the cache to B etc.. Now B is connected to a normal sampler, i.e. Invert, which requries a persistent and unique B cache. I guess that would ruin the strategy? |
|||||||
Posted: July 31, 2020 3:08 am | ||||||||
Vladimir Golovin
Administrator |
Correct. Component A creates the output cache, component B reuses it as the input cache for the cached input (ignoring its cache settings) and produces its output cache, which then gets reused by C's cached input.
Correct. A creates the output cache, B samples it and produces samples, C renders the input cache because it has no cache to reuse from component B. |
|||||||
Posted: July 31, 2020 4:10 am | ||||||||
Rachel Duim
![]() |
Thanks Vlad. The reduction of the cache resolution is perfect for sending a rotation map (derivatives etc) into a Bomber+ loop. Setting it to 50% or 25% works well with little reduction in image quality. The Bitmap Cache component is written for me... I do so much symmetrical image manipulation, it improves the speed of my recursive routines, sometimes by as much as 400%.
Math meets art meets psychedelia. |
|||||||
Posted: August 2, 2020 2:45 pm | ||||||||
Indigo Ray
![]() |
Rachel, I tried the above with This Way filter, setting the cache resolution to 25%, and the render time stayed the same or slowed down slightly.
I tried setting the "blur" (at the beginning) to 25%. I also tried adding a bitmap cache component between the "subtract" (rotation map) and the bomber/offset and setting it to 25%. No luck either way. I understand how to use the lookup/tile (solid fill)/free rectangle components to reduce sampling and speed up filters, but I'm not sure I understand how the bitmap cache settings can be used similarly... |
|||||||
Posted: August 4, 2020 8:22 pm | ||||||||
Rachel Duim
![]() |
First of all, a Bomber or Bomber+ project with a density of 1 will not benefit from the bitmap cache. The cache is helpful for filters that have repetitive operations. So that would be bomber projects with higher densities (above 3?). Or anything with recursion or deep branching. Anything that renders quickly (under 10 seconds) will probably not benefit from the cache.
I've attached a modified Impressionist Curve (FF10 only). The 50% resolution cache is placed at the input of the rotation map into the Bomber+ loop. The filter is about twice as fast on average with the cache. Impressionist Curve cache.ffxml Math meets art meets psychedelia. |
|||||||
Posted: August 4, 2020 9:21 pm | ||||||||
Rachel Duim
![]() |
Here is a modified Koch Crystals. The cache is placed at the end of a group that recursively calls itself up to 5 times. Here is a list of filters that benefit from the cache.
Koch Crystals 3 to 4 times faster Koch Square 50% faster Impressionist Curve 2 times faster Impressionist Channels 2 times faster Pentaflower 25% faster Heptaflower 25% faster Hexaflower 50% faster Octoflower 50% faster Detail Painter 2 times faster Gosper Crystal 2 times faster Distorted Echo Mask 2 times faster Detail Painter 2 to 3 times faster Koch Crystals cache.ffxml Math meets art meets psychedelia. |
|||||||
Posted: August 4, 2020 9:30 pm | ||||||||
Vladimir Golovin
Administrator |
Nice speedups. Is the quality reduction noticeable? |
|||||||
Posted: August 5, 2020 5:18 am | ||||||||
Rachel Duim
![]() |
The quality is fine as far as I can tell. It's all down to knowing what part of the cache tool to use and when. It's a cache, anti-aliasing tool, and resolution (blur like) tool. And much appreciated. I do push those pixels around.
Math meets art meets psychedelia. |
|||||||
Posted: August 5, 2020 11:03 pm |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,712 Registered Users
+19 new in 30 days!
153,533 Posts
+31 new in 30 days!
15,348 Topics
+73 new in year!
23 unregistered users.