POV-Ray : Newsgroups : povray.binaries.images : 'Accidental' isosurface Server Time
14 Nov 2024 04:32:35 EST (-0500)
  'Accidental' isosurface (Message 1 to 10 of 68)  
Goto Latest 10 Messages Next 10 Messages >>>
From: CShake
Subject: 'Accidental' isosurface
Date: 16 Nov 2009 20:30:15
Message: <4b01fca7@news.povray.org>
After seeing the mandelbulb getting some press recently on slashdot, I 
started to wonder how close I could get with povray.
I forgot to segment the parts of the isosurface into the x,y,z 
components (added them instead), and this happened, at least it's fun 
looking.

#local n = 8;
#local r = function{sqrt(pow(x,2)+pow(y,2)+pow(z,2))};
#local theta = function{atan2(sqrt(pow(x,2)+pow(y,2)),z)};
#local phi = function{atan2(y,x)};
isosurface{
   function { 
pow(r(x,y,z),n)*(sin(theta(x,y,z)*n)*cos(phi(x,y,z)*n)+sin(theta(x,y,z)*n)*sin(phi(x,y,z)*n)+cos(theta(x,y,z)*n))

}
   threshold 0
   max_gradient 57
   contained_by {sphere{0,1}}
   texture{
     pigment{color rgb 0.8}
     finish{ambient 0 diffuse 1}
   }
}


Post a reply to this message


Attachments:
Download 'mandelball.jpg' (22 KB)

Preview of image 'mandelball.jpg'
mandelball.jpg


 

From: Rick Gutleber
Subject: Re: 'Accidental' isosurface
Date: 17 Nov 2009 17:05:40
Message: <4b031e34$1@news.povray.org>
That's cool.

I've been wondering the same thing, but I haven't made any effort to 
find out if it's possible to do the Mandelbulb in POV.  I figure someone 
who knows a lot more than me will figure it out first.

On 2009-11-16 20:30, CShake wrote:
> After seeing the mandelbulb getting some press recently on slashdot, I
> started to wonder how close I could get with povray.
> I forgot to segment the parts of the isosurface into the x,y,z
> components (added them instead), and this happened, at least it's fun
> looking.
>
> #local n = 8;
> #local r = function{sqrt(pow(x,2)+pow(y,2)+pow(z,2))};
> #local theta = function{atan2(sqrt(pow(x,2)+pow(y,2)),z)};
> #local phi = function{atan2(y,x)};
> isosurface{
> function {
>
pow(r(x,y,z),n)*(sin(theta(x,y,z)*n)*cos(phi(x,y,z)*n)+sin(theta(x,y,z)*n)*sin(phi(x,y,z)*n)+cos(theta(x,y,z)*n))
> }
> threshold 0
> max_gradient 57
> contained_by {sphere{0,1}}
> texture{
> pigment{color rgb 0.8}
> finish{ambient 0 diffuse 1}
> }
> }


Post a reply to this message

From: scott
Subject: Re: 'Accidental' isosurface
Date: 19 Nov 2009 07:51:56
Message: <4b053f6c$1@news.povray.org>
> I've been wondering the same thing, but I haven't made any effort to find 
> out if it's possible to do the Mandelbulb in POV.  I figure someone who 
> knows a lot more than me will figure it out first.

I think it would be easiest (ie not take 400 years) if you made a program in 
a faster language (eg C++) to write a df3 file, and then used POV to render 
the df3 file as an isosurface.


Post a reply to this message

From: CShake
Subject: Re: 'Accidental' isosurface
Date: 19 Nov 2009 09:06:56
Message: <4b055100$1@news.povray.org>
scott wrote:
>> I've been wondering the same thing, but I haven't made any effort to 
>> find out if it's possible to do the Mandelbulb in POV.  I figure 
>> someone who knows a lot more than me will figure it out first.
> 
> I think it would be easiest (ie not take 400 years) if you made a 
> program in a faster language (eg C++) to write a df3 file, and then used 
> POV to render the df3 file as an isosurface.
> 
> 

Like this?
http://news.povray.org/povray.binaries.animations/thread/%3Cweb.4b02da71bde7fd6d299b4a940%40news.povray.org%3E/
That 256x256x256 df3 took a few minutes to generate on my machine, so 
the proof of concept works.

I haven't optimized the code too far yet, it's still using the trig 
functions, but it can be used for any value N. It's ready to render a 
XxYxZ resolution mesh at any zoom, defined by passing min and max values 
for each dimension. Unfortunately it's not multi-threaded yet either, 
but as soon as I learn a bit more about how to write that, the structure 
of the code will require very little modification to allow that.

Chris


Post a reply to this message

From: scott
Subject: Re: 'Accidental' isosurface
Date: 19 Nov 2009 10:12:12
Message: <4b05604c@news.povray.org>
> Like this?
>
http://news.povray.org/povray.binaries.animations/thread/%3Cweb.4b02da71bde7fd6d299b4a940%40news.povray.org%3E/
> That 256x256x256 df3 took a few minutes to generate on my machine, so the 
> proof of concept works.

Hehe I just did the same :-)  Mine was 1024x1024x1024 df3 file which took 
about half an hour multithreaded under c#.net (I decided the speedup I could 
get by easy multithreading in c# outweighed the speedup I could get with C++ 
over C#).  The render only took about 2 minutes, it's just an isosurface and 
a few lights.

> I haven't optimized the code too far yet, it's still using the trig 
> functions, but it can be used for any value N.

Yeh mine too, it looks like there should be a way to lose the trig even with 
N=8, but it might get a bit scary...

> Unfortunately it's not multi-threaded yet either, but as soon as I learn a 
> bit more about how to write that, the structure of the code will require 
> very little modification to allow that.

Yeh, I chose to do it under C# because it's very easy to do the 
multithreading on there and I have no experience of doing multithreading on 
normal C++.  I just wanted to get something working this afternoon to see 
what it looked like.

The issue is that the isosurface is still made up of millions of little cube 
shaped voxels, I think the only way to improve that is to write a 
fractal-ray tracer too!  Or maybe patch POV...


Post a reply to this message


Attachments:
Download 'mandelbulb.jpg' (112 KB)

Preview of image 'mandelbulb.jpg'
mandelbulb.jpg


 

From: Kirk Andrews
Subject: Re: 'Accidental' isosurface
Date: 19 Nov 2009 10:58:33
Message: <4b056b29$1@news.povray.org>
scott wrote:
>> Like this?
>>
http://news.povray.org/povray.binaries.animations/thread/%3Cweb.4b02da71bde7fd6d299b4a940%40news.povray.org%3E/

>>
>> That 256x256x256 df3 took a few minutes to generate on my machine, so 
>> the proof of concept works.
> 
> Hehe I just did the same :-)  Mine was 1024x1024x1024 df3 file which 
> took about half an hour multithreaded under c#.net (I decided the 
> speedup I could get by easy multithreading in c# outweighed the speedup 
> I could get with C++ over C#).  The render only took about 2 minutes, 
> it's just an isosurface and a few lights.
> 
>> I haven't optimized the code too far yet, it's still using the trig 
>> functions, but it can be used for any value N.
> 
> Yeh mine too, it looks like there should be a way to lose the trig even 
> with N=8, but it might get a bit scary...
> 
>> Unfortunately it's not multi-threaded yet either, but as soon as I 
>> learn a bit more about how to write that, the structure of the code 
>> will require very little modification to allow that.
> 
> Yeh, I chose to do it under C# because it's very easy to do the 
> multithreading on there and I have no experience of doing multithreading 
> on normal C++.  I just wanted to get something working this afternoon to 
> see what it looked like.
> 
> The issue is that the isosurface is still made up of millions of little 
> cube shaped voxels, I think the only way to improve that is to write a 
> fractal-ray tracer too!  Or maybe patch POV...
> 
> 
> ------------------------------------------------------------------------
> 

Amazing!  I wish I was half as smart as all these programmers around 
here.  I'd love to see a large and detailed render.


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: 'Accidental' isosurface
Date: 19 Nov 2009 14:08:06
Message: <4b059796$1@news.povray.org>
scott wrote:
>> Like this?
>> http://news.povray.org/povray.binaries.animations/thread/%3Cweb.4b02da
71bde7fd6d299b4a940%40news.povray.org%3E/ 
>>
>> That 256x256x256 df3 took a few minutes to generate on my machine, so 

>> the proof of concept works.
> 
> Hehe I just did the same :-)  Mine was 1024x1024x1024 df3 file which 
> took about half an hour multithreaded under c#.net (I decided the 
> speedup I could get by easy multithreading in c# outweighed the speedup
 
> I could get with C++ over C#).  The render only took about 2 minutes, 
> it's just an isosurface and a few lights.
> 
>> I haven't optimized the code too far yet, it's still using the trig 
>> functions, but it can be used for any value N.
> 
> Yeh mine too, it looks like there should be a way to lose the trig even
 
> with N=8, but it might get a bit scary...
> 
>> Unfortunately it's not multi-threaded yet either, but as soon as I 
>> learn a bit more about how to write that, the structure of the code 
>> will require very little modification to allow that.
> 
> Yeh, I chose to do it under C# because it's very easy to do the 
> multithreading on there and I have no experience of doing multithreadin
g 
> on normal C++.  I just wanted to get something working this afternoon t
o 
> see what it looked like.
> 
	Well, if your compiler supports OpenMP, the multithreading is as 
simple as including omp.h and writing "#pragma omp parallel for 
shared(a)" just before your outer loop (where "a" is the name of the 
array in which you store your results)...

See: https://computing.llnl.gov/tutorials/openMP/

		Jerome
-- 
mailto:jeb### [at] freefr
http://jeberger.free.fr
Jabber: jeb### [at] jabberfr


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

From: clipka
Subject: Re: 'Accidental' isosurface
Date: 19 Nov 2009 20:29:15
Message: <4b05f0eb$1@news.povray.org>
scott schrieb:
> 
> The issue is that the isosurface is still made up of millions of little 
> cube shaped voxels, I think the only way to improve that is to write a 
> fractal-ray tracer too!  Or maybe patch POV...

... or use the "interpolate" keyword?

If you use tricubic interpolation, you may want to change your generator 
program though, to output not values 0 and 255, but something like 64 
and 192, as some versions of POV-Ray have bugs in the interpolation code 
that may otherwise cause artifacts due to "overshoot".


Post a reply to this message

From: scott
Subject: Re: 'Accidental' isosurface
Date: 20 Nov 2009 02:47:53
Message: <4b0649a9@news.povray.org>
> ... or use the "interpolate" keyword?

It's already using interpolate 1 (interpolate 2 was very slow and I couldn't 
see much difference from this zoom), but as all voxels are either 0 or 255 
you still get a very rough look.

> If you use tricubic interpolation, you may want to change your generator 
> program though, to output not values 0 and 255, but something like 64 and 
> 192,

Yeh good idea, I could do something clever in the df3 generator to output a 
varying value depending on how "close" the voxel is to the border.


Post a reply to this message

From: scott
Subject: Re: 'Accidental' isosurface
Date: 20 Nov 2009 07:38:42
Message: <4b068dd2@news.povray.org>
> Amazing!  I wish I was half as smart as all these programmers around here. 
> I'd love to see a large and detailed render.

Better?  There are still artifacts due to the discrete nature of the df3 
file, but I'm working on it.

Generating a df3 file from code outside of POV is not very hard.  And I just 
copied the formulas to generate the fractal from the websites referenced.


Post a reply to this message


Attachments:
Download 'mandelbulb4.jpg' (490 KB)

Preview of image 'mandelbulb4.jpg'
mandelbulb4.jpg


 

Goto Latest 10 Messages Next 10 Messages >>>

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