noise generators (forked from: Krita user community?)
Matthew Woehlke
mw_triad at users.sourceforge.net
Mon Feb 25 18:30:33 CET 2008
Cyrille Berger wrote:
> Yes it does. The point about threading is that the filter isn't necesserally
> run in one pass on the full image. We might split it into two area (ie
> [0x0,500x250] and [0x250,500x250], and if you are not carefull with your
> random number you get a discontinuity at y=250.
Hmm... how does this work for e.g. convolution filters that require data
with N pixels of the target pixel in order to calculate that pixel?
This is going to make the algorithm rather more complicated, as the edge
pixels depend on toroidal wrapping of the image; enough excess will have
to be calculated (and discarded) so that the edges of the actual slice
are correct, and those coordinates will have to be mapped to their
toroidal equivalents. (In other words, this *will* break unless it knows
the overall image dimensions as well as the dimensions of its slice. And
the memory usage is rather less than ideal.) I think that means
calculating a portion requires not less than one full extra wavelength
on every side. Not pretty, but needed if we want partial updates.
Of course, another question might be if we care about partial updates?
If not, a (much) simpler way would be to parallelize only the guts of
each sub-pass and lockstep all threads between passes. This would allow
one thread per pixel (except many would have nothing to do the first
pass), since the data is write-once.
--
Matthew
"Doggy!" -- Robots from Freefall (http://freefall.purrsia.com)
More information about the kimageshop
mailing list