|
|
In article <3db318e9@news.povray.org>, "Slime" <slm### [at] slimelandcom>
wrote:
> So what I need is some sort of syntax to let the user decide what noise
> generator to use with an internal function. I can't come up with anything.
> Any suggestions?
Maybe we should collaborate. I want to completely redo the noise
generator syntax, and dump the existing noise_generator code entirely
(it is too hard to make additions and extensions).
#declare Perlin =
function {perlin_noise {NOISE_GENERATOR_STUFF}}
#declare OldNoise =
function {old_noise {rescale on|off NOISE_GENERATOR_STUFF}}
#declare Lewis =
function {
lewis_noise {
cos|cone|scurve|function
impulses NUM_IMPULSES
NOISE_GENERATOR_STUFF
}
}
#declare Perlin4D =
function {
perlin_4d_noise {
slice TIME_PARAM
NOISE_GENERATOR_STUFF
}
}
NOISE_GENERATOR_STUFF would be:
seed SEED
For creating generators with different seeds.
range MIN, MAX
For setting the output range. Default would be either [-1, 1] or [0, 1].
To use a declared generator:
#declare val = Perlin(1, 2, 3);
#declare val = Perlin4D(1, 2, 3);
#declare val = Perlin4D(1, 2, 3, 4);//slice parameter overridden
pigment {bozo noise_generator Lewis}
function {OldNoise(x, y, z)}
You wouldn't need to declare it:
pigment {bozo noise_generator lewis_noise {...}}
Oh, and any function could be used as a noise generator:
pigment {bozo noise_generator function {pow(sin(Lewis(x, y, z)), 2)}}
I think this could be pulled off without breaking existing scenes.
No scenes depended on the discontinuous second derivatives, so that
option would be removed (or the old function could be kept as a faster
option). Don't know what to do about the repeating. It'd be nice if it
could be done for all the generators without slowing them down.
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|