POV-Ray : Newsgroups : povray.newusers : Volume rendering with POV-Ray Server Time
23 Nov 2024 20:59:53 EST (-0500)
  Volume rendering with POV-Ray (Message 1 to 8 of 8)  
From: Bene
Subject: Volume rendering with POV-Ray
Date: 3 Nov 2011 10:45:01
Message: <web.4eb2a86547b2adf8db4fdb9b0@news.povray.org>
Hi,

for the past few years, I developed a 3D visualization tool for ImageJ/Fiji
(http://3dviewer.neurofly.de). A few days ago I came across POV-Ray, did some
experimenting with it and liked it. I would now like to write an export function
for my 3D Viewer to the POV-Ray format, allowing for beautiful, high-quality
renderings.

Everything worked fine so far except for volume renderings. I googled a lot and
found some information, made some progress, but am still not satisfied. After
playing with various media and density parameters without much success, I'd now
like to ask the experts for advice.

Basically this is the image I see in my 3D Viewer (the volume rendering is based
on 2D texture mapping, with a linear transfer function from black being fully
transparent to white being fully opaque).

http://132.187.25.13/home/bene/3dviewer.png

Trying my best with POV-Ray let me produce this result:

http://132.187.25.13/home/bene/povray.png

My question is: How could I improve my POV-Ray rendering, to look more similar
to the 3DViewer rendering?

My own assumption is that there's something wrong with the transfer function. In
the 3D Viewer, both dark and bright colors are produced, while in the POV-Ray
rendering, I only obtain bright colors.

Any hints are greatly appreciated.

Best,
Bene

PS:
here's the relevant code snippet:

box {
        0.0, 1.0
        texture {
                pigment {
                        rgbt 1.0
                }
        }
        interior {
                media {
                        emission 10
                        absorption 0
                        scattering { 1 0 }
                        intervals 100
                        samples 2, 2
                        method 2
                        confidence 0.999
                        variance 1/1000

                        density {
                                density_file df3 "substack.df3" interpolate 1
                                color_map
                                {
                                        [ 0.0   rgb <0, 0, 0> ]
                                        [ 1.0   rgb <1, 1, 1> ]
                                }
                        }
                }
        }
        hollow
        no_shadow
        translate <-0.5,-0.5, -0.5>
        rotate <0, -45, 0>
}


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Volume rendering with POV-Ray
Date: 3 Nov 2011 14:30:57
Message: <4eb2dde1@news.povray.org>
Bene wrote:

 > in the POV-Ray rendering, I only obtain bright colors.

I think in your case you should only use scattering media.
The strong emission basically means the dense areas emit light
while the non-dense areas are transparent (note that you need
a light source then, which you might not have now).

> here's the relevant code snippet:

I'd recommend to make the density file and full scene
available for download, so it will be easier for people to
play with the settings and compare it to your render.


Post a reply to this message

From: Bene
Subject: Re: Volume rendering with POV-Ray
Date: 4 Nov 2011 06:50:01
Message: <web.4eb3c333fe2775e4db4fdb9b0@news.povray.org>
Hi,

thanks for the answer.

Christian Froeschlin <chr### [at] chrfrde> wrote:

>
> I think in your case you should only use scattering media.
> The strong emission basically means the dense areas emit light
> while the non-dense areas are transparent (note that you need
> a light source then, which you might not have now).

I also tried to use only scattering, and no emission at all,
however the results were even less satisfactory. It may however
be that the parameters I tried were not optimal.

> I'd recommend to make the density file and full scene
> available for download, so it will be easier for people to
> play with the settings and compare it to your render.

True. You can access the scene file here:
http://132.187.25.13/home/bene/substack.pov

and the required df3 file here:
http://132.187.25.13/home/bene/substack.resampled.df3

Best,
Bene


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Volume rendering with POV-Ray
Date: 4 Nov 2011 19:24:05
Message: <4eb47415@news.povray.org>
Bene wrote:

> True. You can access the scene file here:
> and the required df3 file here:

they don't seem to be there (btw you might not be aware that
the directory is configured to allow browsing all files).


Post a reply to this message

From: Bene
Subject: Re: Volume rendering with POV-Ray
Date: 5 Nov 2011 07:40:01
Message: <web.4eb52069fe2775e47c9fea0@news.povray.org>
> they don't seem to be there (btw you might not be aware that
> the directory is configured to allow browsing all files).

upps, sorry. Should work now.

Thanks


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Volume rendering with POV-Ray
Date: 6 Nov 2011 11:08:58
Message: <4eb6b11a@news.povray.org>
Bene wrote:

> upps, sorry. Should work now.

except that the machine itself appears to be down ;)


Post a reply to this message

From: Bene
Subject: Re: Volume rendering with POV-Ray
Date: 7 Nov 2011 12:45:01
Message: <web.4eb8187cfe2775e4db4fdb9b0@news.povray.org>
>
> except that the machine itself appears to be down ;)

Yeah, everything seems to come together. Never mind, the server is up again.


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Volume rendering with POV-Ray
Date: 7 Nov 2011 15:24:41
Message: <4eb83e89$1@news.povray.org>
Bene wrote:

> My own assumption is that there's something wrong with the transfer function. In
> the 3D Viewer, both dark and bright colors are produced, while in the POV-Ray
> rendering, I only obtain bright colors.

I just read up a bit on volume rendering and think POV-Ray media
cannot currently render the kind of image you want. The transfer
function itself is probably not the problem but your sample image
is shaded, and as far as I know, POV-Ray doesn't use shading for
media (i.e., calculate gradients within the media to consider the
"surface" normals at the sample points). It was more designed
to render things like mist, light beams, fire.

This would probably require to implement a new media type
in addition to emission, absorption, and scattering.

What you could try is to export geometry instead of df3.
A possibility might be to split your voxels into a number
of discrete tranparency levels and export one blob object
for each.


Post a reply to this message

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