Gmur
Posts: 3 |
so... I just whanted to realize FFT algorithm in a simple way avoiding the greatest Sample-Based Architecture
![]() 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; |
|||
Posted: September 15, 2010 1:39 am | ||||
Sphinx.
![]() |
I tried out something similar. It is not currently possible to implement in an efficient way. Check out this discussion.
|
|||
Posted: September 15, 2010 2:03 am | ||||
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.
|
|||
Posted: September 15, 2010 3:17 am | ||||
Sphinx.
![]() |
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. |
|||
Posted: September 15, 2010 11:23 am | ||||
Gmur
Posts: 3 |
get_sample_map is something like readonly buffer already, isn't it?
Ok, We'll wait for better times ![]() ![]() |
|||
Posted: September 16, 2010 12:32 am | ||||
tigerAspect |
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 |
|||
Posted: September 18, 2010 10:21 am | ||||
Kraellin
![]() |
cool image, gmur
![]() If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|||
Posted: September 18, 2010 11:34 pm | ||||
Dmitry Sapelnikov |
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.) |
|||
Posted: September 21, 2010 2:36 am | ||||
tigerAspect |
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. |
|||
Posted: September 21, 2010 9:45 am | ||||
Sphinx.
![]() |
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. |
|||
Posted: September 22, 2010 3:15 am | ||||
tigerAspect |
Yeah, that's basically what I meant. ![]() 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. |
|||
Posted: September 22, 2010 7:32 am | ||||
Dmitry Sapelnikov |
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.
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. |
|||
Posted: September 24, 2010 2:42 am | ||||
xirja
![]() |
The version 4 release will have this Bitmap-based Scripting component? _____________________________________________________
http://web.archive.org/web/2021062908...rjadesign/ _____________________________________________________ |
|||
Posted: October 4, 2011 8:00 pm | ||||
CorvusCroax
![]() |
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 |
|||
Posted: January 19, 2012 4:06 pm |
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!
15 unregistered users.