YOUR ACCOUNT

Login or Register to post new topics or replies
dmorrill
Posts: 15
Based on my testing so far, here are a few quick scripting tips:

- The x,y values passed to your 'get_sample' function may not be in the range (0..1), so be sure that your code handles those cases correctly. In my case, I've been seeing values like: -0.005 and 1.005, which is probably caused by FF's anti-aliasing supersampling logic.

- You can use the 'error( string )' function to display 'string' in the FF message log window (e.g. error('x='..x..' y='..y) ). It has the additional side effect of displaying the line # containing the 'error' call as well as terminating the script's execution (so you can't use it to log trace data).

- To get around the current small scripting window in the FF beta, I've been using an external editor and using the Ctrl-A/Ctrl-C and Ctrl-A/Ctrl-V key combos (on Windows) to move the code quickly from the external editor to FF.
David Morrill
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Quote
dmorrill wrote:
The x,y values passed to your 'get_sample' function may not be in the range (0..1),


Regarding the sample coordinates and coordinate system, see this article:
http://www.filterforge.com/wiki/index...&rcid=1740

The range of FF sample coordinates is not 0...1 -- it is unlimited (practically, it is limited by the capacity of double-precision floating point.) Essentially, a sample-based component implements an infinite textured plane.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Here is a trick when working with fractal systems designed for plotting and not sampling (i.e. the iteration loop plots colors at some coordinate, which we can't do in a procedural rendering context).

After the iteration loop, you can calculate the distance between the produced coordinate and the current input x,y

You may need to scale the coordinates and of course the result to get a decent range.

pseudo script:

while (some_resume_condition == true) and (iteration < MAX_ITERATION) do
out_x, out_y = --formula here
iteration = iteration + 1
end
local d = math.sqrt((out_x - x * range)^2 + (out_y - y * range)^2)

first you should check roughly what range out_x and out_y and then scale input coordinates accordingly (via range). You can output out_x and out_y temporarily in color channels and inspect via color picker.

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

15,348 Topics
+73 new in year!

Create an Account

Online Users Last minute:

42 unregistered users.