YOUR ACCOUNT

Login or Register to post new topics or replies
TenOxWagon
Developer, designer, artist
Posts: 2
I would love to see a new component, possibly as a piece of Loop components like the accumulator or randomizer, that performs caching.

I have been working with the Loop component to create a hair texture filter by layering individual hair strands, which are manipulated by randomized components, over each other. The first part of this filter uses a chain of components to create a single hair strand, this is then fed into a Loop component where the strand is randomized and layered.

The filter takes quite a while to render, which is expected. In trying to optimize it for better speed, I discovered that if I saved an image of a hair strand and replaced the first portion of the filter with this pre-made image I get a dramatic difference in render time. The version of the filter that creates it's own hair strand takes about 40% longer than the filter that uses the pre-made image.

From reading about how Filter Forge's render engine works, I've come to a conclusion about this render time disparity. Every time the Loop iterates, it re-processes the the hair strand generating portion of the filter even though it is guaranteed to get the same result it did last time. It doesn't realize that none of the per-iteration change components (like randomizer, position, etc) are up-stream of this point.

A simple solution to this problem is to create a caching component. The way this component would work is (potentially) simple: when asked for a pixel, it checks an internal cache to see if that pixel has been supplied before. If it has, it supplies the same result again. If it hasn't, then it goes up-stream and asks the components connected to it for their results, saves the result in the internal cache, and then supplies it.
  Details E-Mail
Sphinxmorpher
Filter Optimizer

Posts: 1750
Filters: 39
The bitmap based components may be used for caching if used outside the loop "circuit".
Try placing a blur with radius 0.00000001 just before your hair subtree enters the loop.

Take a look at this filter:
https://filterforge.com/filters/4859.html
  Details E-Mail
TenOxWagon
Developer, designer, artist
Posts: 2
That's really helpful, thanks!
  Details E-Mail
emme
Posts: 718
Filters: 8
Btw, it can sometimes be useful to render the cache with higher resolution by scaling up before the bitmap component and then scaling back down after. For example scale 2x -> blur -> scale 0.5 will give you 4 times the samples.
  Details E-Mail

Join Our Community!

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,534 Posts
+31 new in 30 days!

15,348 Topics
+72 new in year!

Create an Account

Online Users Last minute:

25 unregistered users.