|
|
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> Try this:
>
>
> #macro MakeFunction(Fn)
>
> function(N) { Fn(0) + 1 }
>
> #end // macro MakeFunction
Ah, yes. I omitted the function parameters, so it was expecting x, y, z or
something.
That works, thanks.
Of course, when trying to debug some other scene doodle, because math.inc was
squawking at me about VEq, I saw that you already wrote probably exactly what i
needed in the form of fn_Gradient_Directional.
(I'm trying to replicate Shadertoy's / GLSL's fwidth () function):
// fwidth is simply the sum of the absolute values of dfdx and dfdy,
// which signifies the window-space rate of change of the parameter in the x and
y axes, respectively.
// You can determine these by using finite differences
Forward I plod....
- BW
Post a reply to this message
|
|