POV-Ray : Newsgroups : povray.newusers : Rendering voxel-style functions in Povray Server Time
5 Oct 2024 15:29:16 EDT (-0400)
  Rendering voxel-style functions in Povray (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: Mike Williams
Subject: Re: Rendering voxel-style functions in Povray
Date: 6 Sep 2009 14:27:28
Message: <a0FMk$Bc5$oKFwC0@econym.demon.co.uk>
Wasn't it twinbee who wrote:
>> There are a couple options.  I would probably recommend isosurfaces 
>>if you don't
>> actually NEED the grid representation.  It just boils down to a root-finding
>> problem.  That means you can specify an arbitrarily complex function without
>> the need for grids.  I won't go into much detail since others have said it
>> better:
>>
>> http://www.povray.org/documentation/view/3.6.0/73/
>>
>> If you do need a voxel representation, then df3 is the way to go.  Again, the
>> following page gives an excellent description.  You can also use it to create
>> surfaces (i.e. not just volume-rendering), but unless you need more detail
>> here, I won't get carried away.
>>
>> http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/df3/
>
>Hi Ricky, thanks. That page has a sphere function which is very similar to mine
>- great stuff.
>
>My only concern is that an isosurface won't be able to support the colour of
>each bit of the 3D object. With my function I originally posted, one may be
>able to say that for each x/y/z 'voxel', to do some extra processing to
>determine the colour for that bit of object (say based on how its y position or
>something). Is that not possible with the isosurface approach?

You can do that with any type of object, just use a pigment function.

http://www.econym.demon.co.uk/isotut/pigfun.htm

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: twinbee
Subject: Re: Rendering voxel-style functions in Povray
Date: 6 Sep 2009 15:20:00
Message: <web.4aa40a5719a8cf54813aa4820@news.povray.org>
> You can do that with any type of object, just use a pigment function.
>
> http://www.econym.demon.co.uk/isotut/pigfun.htm

Many thanks! I'm guessing other attributes such as variable
translucency or specularity throughout the surface of the material
can be set as well.


Post a reply to this message

From: Mike Williams
Subject: Re: Rendering voxel-style functions in Povray
Date: 6 Sep 2009 16:10:32
Message: <uaPhP5AxcBpKFwOW@econym.demon.co.uk>
Wasn't it twinbee who wrote:
>> You can do that with any type of object, just use a pigment function.
>>
>> http://www.econym.demon.co.uk/isotut/pigfun.htm
>
>Many thanks! I'm guessing other attributes such as variable
>translucency or specularity throughout the surface of the material
>can be set as well.

Specularity is tricky. The specular value of any individual texture is 
constant, so if you want to vary the specularity you have to use more 
than one texture combined in a texture map. See the recent "specular 
texture" thread in this group but use a function instead of 
image_pattern to blend them.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: twinbee
Subject: Re: Rendering voxel-style functions in Povray
Date: 9 Sep 2009 10:20:01
Message: <web.4aa7b81019a8cf54813aa4820@news.povray.org>
Cheers. I may have come across a hurdle or two. I'm going to quote someone from
an email - I'm sure they won't mind:

> The problem is there's no way to incorporate while loops and local
> variables into POV-Ray's isosurface functions. Basically, there are
> functions and there are macros in POV-Ray. Macros can incorporate
> while loops and local variables, but functions cannot. But,
> isosurfaces can only be created using functions.

Is this planned for a future version of POVray?


Post a reply to this message

From: m a r c
Subject: Re: Rendering voxel-style functions in Povray
Date: 9 Sep 2009 12:07:39
Message: <4aa7d2cb@news.povray.org>

web.4aa7b81019a8cf54813aa4820@news.povray.org...
>> The problem is there's no way to incorporate while loops and local
>> variables into POV-Ray's isosurface functions. Basically, there are
>> functions and there are macros in POV-Ray. Macros can incorporate
>> while loops and local variables, but functions cannot. But,
>> isosurfaces can only be created using functions.
>
> Is this planned for a future version of POVray?
>
>
I am not an expert but I think it is not like you just had to want it :-/
Maybe one day if Santa joins the POV-team ... :-)

Marc


Post a reply to this message

From: clipka
Subject: Re: Rendering voxel-style functions in Povray
Date: 9 Sep 2009 12:34:51
Message: <4aa7d92b$1@news.povray.org>
twinbee schrieb:
>> The problem is there's no way to incorporate while loops and local
>> variables into POV-Ray's isosurface functions. Basically, there are
>> functions and there are macros in POV-Ray. Macros can incorporate
>> while loops and local variables, but functions cannot. But,
>> isosurfaces can only be created using functions.
> 
> Is this planned for a future version of POVray?

The answer is a threefold "yes/no/maybe".

"Yes" because there has been some discussion whether POV-Ray 4.0 should 
be equipped with a brand-new SDL, and in that case, whether it might be 
some bytecode-based language that could be used for scene scripting and 
functions alike.

"No" because isosurface functions would probably still be subject to 
major restrictions, or they might screw up the intersection-finding 
algorithm and/or totally kill performance.

"Maybe" because the people to actually have any say in it did not, to my 
knowledge, participate in the discussion, so their opinion on this is 
currently an unknown variable. There seems to be consensus that the SDL 
should get a major overhaul, but to what degree is not yet clear.


Post a reply to this message

From: twinbee
Subject: Re: Rendering voxel-style functions in Povray
Date: 13 Sep 2009 08:55:01
Message: <web.4aaceb7f19a8cf54813aa4820@news.povray.org>
> "Yes" because there has been some discussion whether POV-Ray 4.0 should
> be equipped with a brand-new SDL, and in that case, whether it might be
> some bytecode-based language that could be used for scene scripting and
> functions alike.
>
> "No" because isosurface functions would probably still be subject to
> major restrictions, or they might screw up the intersection-finding
> algorithm and/or totally kill performance.
>
> "Maybe" because the people to actually have any say in it did not, to my
> knowledge, participate in the discussion, so their opinion on this is
> currently an unknown variable. There seems to be consensus that the SDL
> should get a major overhaul, but to what degree is not yet clear.

Thanks. Until then, is there another 3D renderer I can try out which allows
local vars and while loops inside functions like this?


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Rendering voxel-style functions in Povray
Date: 13 Sep 2009 15:46:57
Message: <4aad4c31@news.povray.org>
twinbee wrote:

> Thanks. Until then, is there another 3D renderer I can try out which allows
> local vars and while loops inside functions like this?

Why do you need this? As far as I understand, you do not
actually have voxels as input data, but use functions. You
did not yet explain where the color values come from. If
you have a functional description for that, you can build
a function without a while loop and local variables. The
"select" statement will probably come in handy.

If you actually have independent color data for each voxel,
there are several alternatives:

Worst case, you can just create a bunch of boxes,
should still be possible with a suset of 100x100x100.

You could group the voxels according to color, i.e.,
write multiple df3 files (e.g. one for all red voxels,
one for all blue voxels, ...), assuming there are
not too many color shades.

It would be possible to build arbitrary blocky pigments
using while loops without using a function, by nesting
pigment_maps (i.e, define 10.000 gradient y pigments for
each "stack" of voxels using the voxel colors as color
map, then build slices using 100 gradient z pigments
using the stack-color_maps in a pigment_maps and
finally one gradient x pigment to bring it all
together).


Post a reply to this message

From: twinbee
Subject: Re: Rendering voxel-style functions in Povray
Date: 16 Sep 2009 17:25:00
Message: <web.4ab1573719a8cf54813aa4820@news.povray.org>
> > Thanks. Until then, is there another 3D renderer I can try out which allows
> > local vars and while loops inside functions like this?
>
> Why do you need this?

To create 3D fractals - in particular a 3D version of the
mandelbrot. Unfortunately, while loops are required here.
Here's one example of what I might produce (Rendered by Paul Nylander):

http://www.bugman123.com/Hypercomplex/Mandelbrot-White8-large.jpg


> As far as I understand, you do not
> actually have voxels as input data, but use functions. You
> did not yet explain where the color values come from.

I'm not so worried about the color as yet. Even
mono-hued would be good.


> Worst case, you can just create a bunch of boxes,
> should still be possible with a suset of 100x100x100.

I'm a little worried using voxels will be too slow,
or produce results which aren't satisfactory... (?)
1000 voxels cubed would be minimum I guess.


Post a reply to this message

From: clipka
Subject: Re: Rendering voxel-style functions in Povray
Date: 16 Sep 2009 17:56:33
Message: <4ab15f11$1@news.povray.org>
twinbee schrieb:
> I'm a little worried using voxels will be too slow,
> or produce results which aren't satisfactory... (?)
> 1000 voxels cubed would be minimum I guess.

Hum... that would be a Gigabyte or two even if you'd use a DF3 file.

Maybe it's time for POV-Ray to go for a truly voxel-based file format 
for density files. I wonder whether there are any simple non-proprietary 
file formats out there...

(*gets itchy fingers*)


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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