|
|
waggy wrote:
> CShake wrote:
>> Well, I'm seeing that the actual surface generation and rendering is
>> probably best left to people like you who seem to get good results, so I
>> figured I might as well go another direction with it.
>>
> Wow! That's gorgeous! I can imagine some good uses for it.
>
> To see about making an animated fly-through, I zoomed way in by using trace() to
> place the camera on a surface a few iteration levels above the look_at point on
> the iteration ten (10) surface here rendered. Since I picked starting and
> target points more-or-less at random, I have no idea where this surface is, and
> there is only a single light source placed at the camera location. I also
> shrunk the contained_by (too much, it turned out) to avoid overheating the CPU
> when the sun goes nova.
>
> Are we having too much fun yet?
>
> ~David
>
>
> Trace Time: 1 hours 45 minutes 26 seconds (6326.522 seconds)
> using 8 thread(s) with 47526.303 CPU-seconds total
>
>
> ------------------------------------------------------------------------
>
Here's another one, grayscale generated in c++ in 5 minutes or so
(5000x5000), used as an image_pattern in povray with a color map
applied, rendered at 2500x2500 (15 seconds), then resized down for
upload (and to smooth a bit).
The hardest part is finding where to zoom in actually, there are a lot
of places with nothing, then others with lots of curved lines going the
same way.
Post a reply to this message
Attachments:
Download 'mbslice_colored3.jpg' (281 KB)
Preview of image 'mbslice_colored3.jpg'
|
|
|
|
"abram" wrote:
> So is this a function that you have defined within povray for the isosurface or
> are you using a df3 file?
It's a pair of functions, one to do the iterations, and another to return a
value suitable for making an isosurface. The plan was to add additional
functions better suited to use as a pattern, media, etc.
> Instead of fiddling with user-definable functions within povray I added a new
> function to povray's fnintern.cpp which allowed me to render mandelbulbs with
> povray.
I agree, and thanks for making the patch available. I may take a whack at
modifying it to use PM 2Ring's trigless algorithm.
> I really think the functional approach is superior to the voxel approach since
> getting 1000x1000x1000 voxels is time consuming and space consuming.
>
> But if you did define your own function in isosurface I'd love to see it.
OK. I've avoided posting it since it's an illegal recursive function and can
crash 3.7. It seems to work only when there is just one recursive function
defined, and this recursive function does not call any other user-defined
function. There are posts to this site showing how to unroll these type of
functions using macros to make everything legal, and I may try that, as well.
However, to make a good isosurface I found it necessary to modify the return
value so it is no longer strictly a step function returning a value proportional
to just the iteration number. It seems this is needed so the isosurface's
surface normal can be calculated correctly, and it also speeds rendering and
works with lower max_gradient and larger accuracy values. I probably don't have
the quite the right formulation yet, but what's below works pretty well.
~David Wagner
P.S. Attached are some Easter eggs courtesy of the Basic scene template.
// Persistence of Vision Ray Tracer Scene Description File
// File: mandelbulb.inc
// Vers: 3.6.1, 3.7
// Desc: Mandelbulb Functions
// Date: 11/18/09
// Auth: David Wagner
//Making the return value a float by adding how close to the radius of
convergence REALLY helps!
//Returns 0 to mb_imax+2? Taking off 3 seems to work best.
//This new version seems to have interior surfaces, too.
#declare mb_fn_iterator_frac = function(mb_i,mb_imax, mb_in, x,y,z,
mb_ix,mb_iy,mb_iz) {
select(mb_i > mb_imax | pow(mb_ix,2) + pow(mb_iy,2) + pow(mb_iz,2) >4, 0,
mb_fn_iterator_frac(mb_i+1,mb_imax, mb_in, x,y,z,
x + pow(pow(mb_ix,2) + pow(mb_iy,2) + pow(mb_iz,2) , mb_in/2)
* sin( atan2( sqrt(pow(mb_ix,2) + pow(mb_iy,2)), mb_iz) * mb_in)
* cos( atan2(mb_iy,mb_ix) * mb_in),
y + pow(pow(mb_ix,2) + pow(mb_iy,2) + pow(mb_iz,2) , mb_in/2)
* sin( atan2( sqrt(pow(mb_ix,2) + pow(mb_iy,2)), mb_iz) * mb_in)
* sin( atan2(mb_iy,mb_ix) * mb_in),
z + pow(pow(mb_ix,2) + pow(mb_iy,2) + pow(mb_iz,2) , mb_in/2)
* cos( atan2( sqrt(pow(mb_ix,2) + pow(mb_iy,2)), mb_iz) * mb_in)
),
mb_i + 1/(pow(mb_ix,2) + pow(mb_iy,2) + pow(mb_iz,2) -3 )
)//end select
};
#declare mb_fn_iso = function(x,y,z, mb_fn_n, mb_fn_iterations) {
( mb_fn_iterations - mb_fn_iterator_frac(0,mb_fn_iterations-1, mb_fn_n,
x,y,z, x,y,z) -0.5 )
/ mb_fn_iterations
};
/*
The iteration number is negated so the inside is defined correctly.
Taking off 0.5 here may be a mistake now that the iteration is no longer an
integer...
but it seems to work best for isosurfaces.
*/
/*
//Use the include file as follows:
#include "mandelbulb.inc"
#local mb_n=8; // Mandelbulb Power
#local mb_iterations=6;
#local mb_zoom=2; // Use higher values for tighter views.
isosurface {
function { mb_fn_iso(y, x, z, mb_n, mb_iterations) }
threshold 0.0
contained_by { sphere { <0,0,0>, 1.2 } } //Power 8
//For power 8
accuracy pow(2,-mb_iterations ) /32 /mb_zoom
max_gradient pow(2, mb_iterations/2) *32 *mb_zoom
texture{pigment{color White}}
finish{ambient 0 diffuse 0.9 phong 0.1 specular 0.0}
}
*/
Post a reply to this message
Attachments:
Download 'mb_pattern_basic_set.png' (134 KB)
Preview of image 'mb_pattern_basic_set.png'
|
|