POV-Ray : Newsgroups : povray.advanced-users : <no subject> : Re: <no subject> Server Time
20 May 2024 04:54:03 EDT (-0400)
  Re: <no subject>  
From: Bald Eagle
Date: 4 Jul 2023 15:55:00
Message: <web.64a4789f6f92e8561f9dae3025979125@news.povray.org>
"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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.