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.
|Posted: June 9, 2010 7:25 am|
Regarding the sample coordinates and coordinate system, see this article:
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.
|Posted: June 9, 2010 7:40 am|
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.
while (some_resume_condition == true) and (iteration < MAX_ITERATION) do
out_x, out_y = --formula here
iteration = iteration + 1
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.
Njyldgarkn sample cache!
|Posted: June 10, 2010 4:26 am|
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
15,390 Registered Users
+15 new last day!
+21 new last day!
+15 new in 7 days!
schmigel, 7 unregistered users.