YOUR ACCOUNT

Login or Register to post new topics or replies
Gmur
Posts: 3
so... I just whanted to realize FFT algorithm in a simple way avoiding the greatest Sample-Based Architecture smile:) but... is there any way for faster memory allocation?
for example the code below makes buffer for image and then draws the image from that buffer (only 100x100 pixels) but one cycle of buffer creation takes about 5 sec. so it will be impossible to create 1000x1000 pixel buffer or large. What is the problem or this aproach is impossible to realize?

function prepare()
calculated = 0
a=1
mt = {}
N = 100
M = 100
for i=0,N do
mt[i] = {}
for j=0,M do
mt[i][j] = {0,0,0}
end
end

end;

function cheat()
if calculated==0 then
for i=0,N do
for j=0,M do
mt[i][j][1], mt[i][j][2], mt[i][j][3] = get_sample_map(i/N,j/M,TEST)

end
end
calculated=1
end
return 1

end;

function get_sample(x, y)
cheat()
i=math.ceil(x*(N-1))
j=math.ceil(y*(M-1))
return mt[i][j][1], mt[i][j][2], mt[i][j][3], 1
end;
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I tried out something similar. It is not currently possible to implement in an efficient way. Check out this discussion.
  Details E-Mail
Gmur
Posts: 3
ok... thanks for the link Sphinx. It is really impossible this way then. may be there is some possibility for direct acсessing memory of the input map and using some external prepared c++ library? I read somewhere that there are some kind of possible c++ extensions.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I thought about several workarounds but I can't really find any solution for large temporary buffers. If you only need a "read only" buffer, you can use a blur component in between your source and script (radius at minimum, 0.000000001 or something). This works somewhat like a large cache, but only for reads.

I also looked into loading external libraries, but AFAIK it's something that must be allowed in the host application. We're limited to using external script files (which again is only possible in unsafe mode, so you can't submit to the library) - and this is really not changing anything regarding the whole thread/script duplication issue.

I'm hoping they will soon add some sort of bitmap based script component which internally takes care of handling allocation of temporary buffers and sample collection etc.
  Details E-Mail
Gmur
Posts: 3
get_sample_map is something like readonly buffer already, isn't it?
Ok, We'll wait for better times smile:) Hope FilterForge will be something like NI Reaktor but for pictures. It is a huge lack of interesting and usuable software in 2d graphical industry nowdays. I wanted to realize Fast Fourier transform because with just one dot so many interesting structures can be created and it is a large field of experiments. For example here is a picture of black dot IFFt distored with Flexify2 filter.

  Details E-Mail
tigerAspect
Posts: 222
Filters: 9
Yeah, chalk this up on my wishlist for when we get the Bitmap Script component. I think it now consists of:
Distance Transform
Line Integral Convolution
Fast Fourier Transform
  Details E-Mail
Kraellin
Kraellin

Posts: 12749
Filters: 99
cool image, gmur smile:)
If wishes were horses... there'd be a whole lot of horse crap to clean up!

Craig
  Details E-Mail
Dmitry Sapelnikov
Filter Forge, Inc. AKA Egret
Posts: 76
Filters: 5
Bitmap-based Scripting component is currently in our plans. Actually it has been being in the plans since we started the development of FF scripting. =)
Gmur, thank you for your interest in FF scripting, but unfortunately such snippets are squared wheels =(
The best idea is to understand sampled-based renderers philosophy, not to take attempts to create "adaptive" tools for your old "pixel" skills.
Sample approach is size-independent, it doesn't consume memory and has an ideal support of anti-aliasing.
95% of our rendering algorithms are sample-based. We use bitmap caching only when it can drastically increase speed, usually in case of high sample reusing (blurs, median filters, etc.)
  Details E-Mail
tigerAspect
Posts: 222
Filters: 9
Unfortunately, from my understanding, the three techniques I mention rely on the fundamental nature of bitmaps to function, mostly the ability to compare points in the image in a systemic manner, and thus have no equivalent in sample-based rendering. Distance Transform is a good example, it's closely mathematically related to a Gaussian Blur, which can't be achieved in sample-based rendering (to my knowledge).

Please, feel free to correct me if I'm wrong.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Quote
Unfortunately, from my understanding, the three techniques I mention rely on the fundamental nature of bitmaps to function, mostly the ability to compare points in the image in a systemic manner, and thus have no equivalent in sample-based rendering.
Distance Transform is a good example, it's closely mathematically related to a Gaussian Blur, which can't be achieved in sample-based rendering (to my knowledge).


That is not completely true. Many of the bitmap based components can be implemented in a sample based approach, they will just be extremely heavy (you'd have to fetch the same samples many times and moreover in a way that ruins the sample cache).

While it may look similar, distance transform is very different from gaussian blur in implementation. A distance transform finds the minimum distance to a shape, while blurring is about averaging a region around the given coordinate. They share some properties in the way they can be optimized by multi-pass processing, and the fact that both must assume a minimum sample distance or sample step size (with a bitmap this distance is simply one pixel). In a pure samplebased context you don't have this restriction, you simply pick the samples you need, at any samplerate.
  Details E-Mail
tigerAspect
Posts: 222
Filters: 9
Quote
They share some properties in the way they can be optimized by multi-pass processing, and the fact that both must assume a minimum sample distance or sample step size (with a bitmap this distance is simply one pixel).

Yeah, that's basically what I meant. smile:D I'm not nearly as proficient in these thing as I may like.
I'd actually forgotten that the restriction is not absolute, but it does essentially make it unusable.

The main problem seems to be that a lot of the research into interesting graphical techniques can't really be generalized in an efficient manner to FF's rendering engine.
  Details E-Mail
Dmitry Sapelnikov
Filter Forge, Inc. AKA Egret
Posts: 76
Filters: 5
All signal-processing graphical algorithms can be implemented via sample approach because is's more common technique than bitmaps. In fact a bitmap in the terms of samples is a 2d matrix filled with sampled values on a regular grid.

Quote
tigerAspect wrote:
The main problem seems to be that a lot of the research into interesting graphical techniques can't really be generalized in an efficient manner to FF's rendering engine.

Unfortunately, this is true. FF has a weak support of algorithms which have a high rate of sample reusing. The main obstacle is our "Size" slider. Technically speaking it changes a step of the sampling grid. For absolutely correct processing we have to change cell step in bitmap caches too.

Smaller step - higher cache resolution - increased memory consumption and time for caching. This unpleasant chain makes us to invite tricks and hacks for our bitmap-based components as it gets us an ability to not change the resolution of caches while FF filter scaling works.
  Details E-Mail
xirja
Idididoll Forcabbage

Posts: 1698
Filters: 8
Quote
Bitmap-based Scripting component is currently in our plans. Actually it has been being in the plans since we started the development of FF scripting. =)


The version 4 release will have this Bitmap-based Scripting component?
_____________________________________________________

http://web.archive.org/web/2021062908...rjadesign/
_____________________________________________________
  Details E-Mail
CorvusCroax
CorvusCroax

Posts: 1227
Filters: 18
Hey: I posted in the 'General' forum about the latest MIT breakthroughs for Super Fast ("near optimal") Fourier Transforms:
http://www.filterforge.com/forum/read...5&TID=9331


Paper here: http://arxiv.org/abs/1201.2501v1
Article here: http://web.mit.edu/newsoffice/2012/fa...-0118.html
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,711 Registered Users
+18 new in 30 days!

153,533 Posts
+38 new in 30 days!

15,348 Topics
+73 new in year!

Create an Account

Online Users Last minute:

15 unregistered users.