POV-Ray : Newsgroups : povray.programming : Noise Function Server Time
29 Jul 2024 04:22:56 EDT (-0400)
  Noise Function (Message 1 to 7 of 7)  
From: Steven Jones
Subject: Noise Function
Date: 29 Oct 1998 16:28:30
Message: <3638DDF9.5E6D0423@spiderweb.com.au>
Is there a noise function in POV 3.02?


Post a reply to this message

From: Ron Parker
Subject: Re: Noise Function
Date: 29 Oct 1998 16:40:16
Message: <3638e0c0.0@news.povray.org>
On Fri, 30 Oct 1998 07:28:25 +1000, Steven Jones 
	<ste### [at] spiderwebcomau> wrote:
>Is there a noise function in POV 3.02?

The answer to this depends on what you're trying to do with it.  If 
you're hacking the POV source code, which is what we discuss in this
group, then the answer is yes; look in textures.c, the function is
called (appropriately enough) Noise.  

If, however, you're looking for a function to do what Noise does in
a POV script, the answer is "no, and you could have found that answer
much more quickly by reading the fine documentation."

Finally, if you're looking for someone to write a function to do what
Noise does in a POV script, then you asked in the right group.  It's
really easy to add, but nobody's ever asked for it.  Maybe it'll find
its way into the superpatch before I freeze development on it.


Post a reply to this message

From: Jerry Anning
Subject: Re: Noise Function
Date: 30 Oct 1998 00:16:17
Message: <36394BA9.70E0E967@dhol.com>
Ron Parker wrote:
> 
> On Fri, 30 Oct 1998 07:28:25 +1000, Steven Jones
>         <ste### [at] spiderwebcomau> wrote:
> >Is there a noise function in POV 3.02?
> 
> The answer to this depends on what you're trying to do with it.  If
> you're hacking the POV source code, which is what we discuss in this
> group, then the answer is yes; look in textures.c, the function is
> called (appropriately enough) Noise.
> 
> If, however, you're looking for a function to do what Noise does in
> a POV script, the answer is "no, and you could have found that answer
> much more quickly by reading the fine documentation."
> 
> Finally, if you're looking for someone to write a function to do what
> Noise does in a POV script, then you asked in the right group.  It's
> really easy to add, but nobody's ever asked for it.  Maybe it'll find
> its way into the superpatch before I freeze development on it.

What about the noise3d function from the Isosurface patch?

Jerry Anning
cle### [at] dholcom


Post a reply to this message

From: Ron Parker
Subject: Re: Noise Function
Date: 30 Oct 1998 08:24:57
Message: <3639be29.0@news.povray.org>
On Fri, 30 Oct 1998 00:16:25 -0500, Jerry Anning <cle### [at] dholcom> wrote:
>Ron Parker wrote:

>> Finally, if you're looking for someone to write a function to do what
>> Noise does in a POV script, then you asked in the right group.  It's
>> really easy to add, but nobody's ever asked for it.  Maybe it'll find
>> its way into the superpatch before I freeze development on it.
>
>What about the noise3d function from the Isosurface patch?

You can't use it in an expression.  It only works in isosurfaces, implicits,
parametrics, and textures: basically, everywhere you can use a #declared
function.

That's not to say it _couldn't_ work, only that it doesn't.


Post a reply to this message

From: Michael Andrews
Subject: Re: Noise Function
Date: 30 Oct 1998 12:00:25
Message: <3639F091.B68B1098@remove-this.reading.ac.uk>
Ron Parker wrote:

> On Fri, 30 Oct 1998 00:16:25 -0500, Jerry Anning <cle### [at] dholcom> wrote:
> >Ron Parker wrote:
>
> >> Finally, if you're looking for someone to write a function to do what
> >> Noise does in a POV script, then you asked in the right group.  It's
> >> really easy to add, but nobody's ever asked for it.  Maybe it'll find
> >> its way into the superpatch before I freeze development on it.
> >
> >What about the noise3d function from the Isosurface patch?
>
> You can't use it in an expression.  It only works in isosurfaces, implicits,
> parametrics, and textures: basically, everywhere you can use a #declared
> function.
>
> That's not to say it _couldn't_ work, only that it doesn't.

 One patch I made to my v3.02 code was an "evaluate" function which took a
declared isosurface function and a position vector, returning the value of the
function at that position. I am not sure if I still have a copy of this, but I
remember it being quite a simple to patch to implement, mostly an extra function
in the expression parsing code.
    I was going to try extending this to return values for any texture pattern,
but v3.1 betas started ariving and I got very sidetracked ... Thinking about it,
it may be easier in v3.1 - the relavent code to get a pattern value must be in
several places, so all that's needed is a wrapper function in the expression
parser? I'll try to peruse the SuperPatch source and see if I can put a
patchette together this weekend :-)

    Bye for now,
        Mike Andrews.


Post a reply to this message

From: Ron Parker
Subject: Re: Noise Function
Date: 30 Oct 1998 12:45:12
Message: <3639fb28.0@news.povray.org>
On Fri, 30 Oct 1998 17:00:01 +0000, Michael Andrews 
	<M.C### [at] remove-thisreadingacuk> wrote:
> One patch I made to my v3.02 code was an "evaluate" function which took a
>declared isosurface function and a position vector, returning the value of the
>function at that position. I am not sure if I still have a copy of this, but I
>remember it being quite a simple to patch to implement, mostly an extra function
>in the expression parsing code.

I'm not sure you'd even need an explicit "evaluate" function.  It seems 
you could just automatically evaluate an isosurface function if presented 
with its name: 

#declare myvec=<1,2,0>;
#declare myfunc=function{sin(x)*cos(y)}
#declare myval=myfunc(myvec);

This is just a tiny patch to the code in express.c, and without any 
confusing syntactical overhead for the user.  (Probably faster than 
a macro, too, where either would be acceptable... hmm... )

>    I was going to try extending this to return values for any texture pattern,
>but v3.1 betas started ariving and I got very sidetracked ... Thinking about it,
>it may be easier in v3.1 - the relavent code to get a pattern value must be in
>several places, so all that's needed is a wrapper function in the expression
>parser? I'll try to peruse the SuperPatch source and see if I can put a
>patchette together this weekend :-)

The colo[u]r_at( pigment, vector ) function is something I've been 
toying with adding as well.  It is very easy; the compute_pigment 
function in pigment.c does exactly what you need.  All you need to
do is call it with the appropriate parameters.

You could also forgo the colo[u]r_at (evaluate, whatever) token by 
extending the syntax to allow

#declare center=<5,3,2>;
#declare radius=1;
#declare mypigment=pigment{...}
sphere { center, radius texture {pigment {color mypigment(center)}}}

but I'm not sure whether it would make sense to the average user to 
see a pigment evaluated at a point like this.  Any comments?


Post a reply to this message

From: Michael Andrews
Subject: Re: Noise Function
Date: 30 Oct 1998 13:12:26
Message: <363A0170.AE0F35E7@remove-this.reading.ac.uk>
Hi Ron,
    I _really_ like the idea of using the function/pigment names as the calling
function name. In my blinkered thinking I simply hadn't considered it a possibility.
I haven't looked at express.c in quite a while, v3.1 not at all, so I wouldn't like
to comment on feasability. But as you say, it should be possible - I can't think
pigment/isosurface type tokens occur in an expression for any other reason.

    If you have the time, I think this would make a nice little extension to the
syntax. I may well try coding it up myself just for fun ...

    All the best,
        Mike Andrews.


Post a reply to this message

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