POV-Ray : Newsgroups : povray.general : Object inside opaque media Server Time
23 Dec 2024 09:20:52 EST (-0500)
  Object inside opaque media (Message 1 to 10 of 26)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Shuffle
Subject: Object inside opaque media
Date: 8 Nov 2018 11:05:00
Message: <web.5be45da7691e1337f5ae96220@news.povray.org>
Hi everyone!

I need to place an object inside a (scattering) media and have the media so
dense I cannot see the object from outside the media. But, and that part is
giving me trouble, the media could be any color, including "dark" ones.

What I actually try to achieve is to model a planet with a dense atmosphere.
Like Venus or, in my case, Saturn's moon Titan. The camera will approach the
body and dive into the atmosphere, revealing the terrain only at lower
altitudes.
You can get a pretty good idea of what I'm trying to achieve by following this
link: https://www.youtube.com/watch?v=9L471ct7YDo&t=55s

What I could not find is a way to set the density using a function{} block and
still be able to control the color independently.

Is that feasible? Bonus points if the color can be set using another function or
a color map, but I could manage with a fixed color and use multiple medias.

No matter what I try, I always end up seeing the body through the atmosphere.
Brighter media color seems more opaque, but that is probably just an artifact
and is not desirable anyway.
Maybe my approach is totally wrong?

Here is the most simple scene I could make to demonstrate my problem:

#version 3.7;

global_settings{
    assumed_gamma 1.0
}

camera {
    location <0.0 , 0.0 ,-3.0>
    right x*image_width/image_height
    look_at <0.0 , 0.0 , 0.0>
}
light_source {
    <1000,2000,-2000>
    color rgb 1
}

sphere {
    <0, 0, 0>, 1
    pigment { color red 1 }
}
sphere {
    <0, 0, 0>, 1.15
    pigment { color transmit 1 }
    interior {
        media {
            absorption rgb 20
            scattering { 5, rgb <0.3, 0.2, 0.1> * 10 eccentricity 0.2 }
            density {
                function { 1 }
            }
        }
    }
    hollow
}


Post a reply to this message

From: Stephen
Subject: Re: Object inside opaque media
Date: 8 Nov 2018 11:59:05
Message: <5be46b59@news.povray.org>
On 08/11/2018 16:02, Shuffle wrote:
>      pigment { color transmit 1 }

Have you tried to use the transmit value to control the transparency of 
the atmosphere?

pigment { colour transmit (function of the distance to the red sphere) }


-- 

Regards
     Stephen


Post a reply to this message

From: Bald Eagle
Subject: Re: Object inside opaque media
Date: 8 Nov 2018 16:20:00
Message: <web.5be4a75addef308a765e06870@news.povray.org>
"Shuffle" <nomail@nomail> wrote:

> What I could not find is a way to set the density using a function{} block and
> still be able to control the color independently.

That gets tricky, but once you understand the concept, it's pretty
straightforward.

Have a look at:
http://news.povray.org/povray.binaries.animations/thread/%3Cweb.5b32f0c22078c5ce458c7afe0%40news.povray.org%3E/

Where we played with this method developed by Bill Pokorny


Post a reply to this message

From: Alain
Subject: Re: Object inside opaque media
Date: 8 Nov 2018 17:04:41
Message: <5be4b2f9$1@news.povray.org>
Le 18-11-08 à 11:02, Shuffle a écrit :
> Hi everyone!
> 
> I need to place an object inside a (scattering) media and have the media so
> dense I cannot see the object from outside the media. But, and that part is
> giving me trouble, the media could be any color, including "dark" ones.
> 
> What I actually try to achieve is to model a planet with a dense atmosphere.
> Like Venus or, in my case, Saturn's moon Titan. The camera will approach the
> body and dive into the atmosphere, revealing the terrain only at lower
> altitudes.
> You can get a pretty good idea of what I'm trying to achieve by following this
> link: https://www.youtube.com/watch?v=9L471ct7YDo&t=55s
> 
> What I could not find is a way to set the density using a function{} block and
> still be able to control the color independently.
> 
> Is that feasible? Bonus points if the color can be set using another function or
> a color map, but I could manage with a fixed color and use multiple medias.
> 
> No matter what I try, I always end up seeing the body through the atmosphere.
> Brighter media color seems more opaque, but that is probably just an artifact
> and is not desirable anyway.
> Maybe my approach is totally wrong?
> 
> Here is the most simple scene I could make to demonstrate my problem:
> 

Try adding some absorbing media. It's density should match that of the 
scattering media, or diminish slightly faster.

media{absorbtion rgb 1} will fade to black as it absorb everything.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Object inside opaque media
Date: 9 Nov 2018 03:01:13
Message: <5be53ec9@news.povray.org>
The following is about the best I can get. Note the use of the parameter 
Scale which enables you to scale the atmosphere without changing its 
characteristics.

#version 3.7;

global_settings{
     assumed_gamma 1.0
}

camera {
     location <0.0 , 0.0 ,-3.0>
     right x*image_width/image_height
     look_at <0.0 , 0.0 , 0.0>
}
light_source {
     <1000, 1000, 1000>
     color rgb 1
}

//planet
sphere {
     <0, 0, 0>, 1
     pigment { color srgb <1,0,0> }
     scale 0.85
}

//atmosphere
#local Scale = 1.1;
sphere {
     <0, 0, 0>, 1
     pigment { color srgbt 1 }
     interior {
         media {
             absorption srgb <0.1, 0.3, 0.5>*10
             scattering {1, srgb <0.3, 0.2, 0.1>*10/Scale /*eccentricity 
0.2*/ }
             density {
               spherical
               density_map {
                 [0.01 rgb 0]
                 [0.30 rgb 1]
                 [0.85 rgb 1]
               }
            }
         }
     }
     hollow
     scale Scale
}


-- 
Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: Object inside opaque media
Date: 9 Nov 2018 03:10:06
Message: <5be540de$1@news.povray.org>
On 9-11-2018 9:01, Thomas de Groot wrote:
>              absorption srgb <0.1, 0.3, 0.5>*10

better to also use:
             absorption srgb <0.1, 0.3, 0.5>*10/Scale


-- 
Thomas


Post a reply to this message

From: clipka
Subject: Re: Object inside opaque media
Date: 9 Nov 2018 03:26:26
Message: <5be544b2$1@news.povray.org>
Am 08.11.2018 um 17:02 schrieb Shuffle:

> What I could not find is a way to set the density using a function{} block and
> still be able to control the color independently.

You could use three independent media blocks, each one affecting only a 
single colour channel.


Post a reply to this message

From: clipka
Subject: Re: Object inside opaque media
Date: 9 Nov 2018 03:30:30
Message: <5be545a6$1@news.povray.org>
Am 09.11.2018 um 09:09 schrieb Thomas de Groot:
> On 9-11-2018 9:01, Thomas de Groot wrote:
>>              absorption srgb <0.1, 0.3, 0.5>*10
> 
> better to also use:
>              absorption srgb <0.1, 0.3, 0.5>*10/Scale

Never try to scale sRGB colours this way. It won't work as expected.

Either use linear colour values, or store the sRGB colour(!) in a 
variable and then scale it (though IIRC the syntax for the latter is 
tricky).


Post a reply to this message

From: Thomas de Groot
Subject: Re: Object inside opaque media
Date: 9 Nov 2018 06:58:57
Message: <5be57681$1@news.povray.org>
On 9-11-2018 9:30, clipka wrote:
> Am 09.11.2018 um 09:09 schrieb Thomas de Groot:
>> On 9-11-2018 9:01, Thomas de Groot wrote:
>>>              absorption srgb <0.1, 0.3, 0.5>*10
>>
>> better to also use:
>>              absorption srgb <0.1, 0.3, 0.5>*10/Scale
> 
> Never try to scale sRGB colours this way. It won't work as expected.
> 
> Either use linear colour values, or store the sRGB colour(!) in a 
> variable and then scale it (though IIRC the syntax for the latter is 
> tricky).

Yes. I remember now. My bad. However, principle for the scene remains 
the same.

-- 
Thomas


Post a reply to this message

From: Shuffle
Subject: Re: Object inside opaque media
Date: 11 Nov 2018 09:30:00
Message: <web.5be83812ddef308a994738e60@news.povray.org>
Ok, many thanks everyone for your replies, I'll try to answer to all of them,
but most suggestions don't apply to my problem or have already been tried... so
I hope to also clarify what I actually need.

> Stephen: Have you tried to use the transmit value to control the transparency of the
atmosphere?
This is not applicable because, for any non-zero transmit value, there will be a
sudden change when the camera goes from outside to inside the media container.
Also, the object inside the media should not become visible as soon as we enter
the atmosphere, only at lower altitudes, as in the video I linked. So even with
a transmit set by a function of the distance to the atmosphere boundary, this
would still not be what I need.

> Bald Eagle: Have a look at:
http://news.povray.org/povray.binaries.animations/thread/%3Cweb.5b32f0c22078c5ce458c7afe0
%40news.povray.org%3E/
This is interesting, especially because I don't use POV 3.8 so I had a glimpse
at new features ;-)
I downloaded alpha9893777 and proceeded to render the (50 frames) animation: at
no moment is the grey plane invisible behind or inside the media. I understand
this is not the purpose of that scene, and the hidden sphere is actually hidden,
but my need is to have an actually visible object, only hidden because of the
density of the media.
Basically, what I want is exactly what happens in nature with fog: the objects
are always there, but as you increase the distance to them, you can't see them
anymore because the droplets absorb their light and diffuse that of the sun
instead. But I can't simply use POV's "fog" feature because I also need to go
from outside to inside the foggy area, and when I'm outside, the foggy area is
in fact a sphere of non-uniform density.

> Alain: Try adding some absorbing media.
That's what I did, including in the scene I posted in my original message. It
does no good: no matter what combinations of absorption and scattering, you can
always see the object through the media. Emission is obviously not an option,
because the unlit hemisphere must stay black.

> Thomas de Groot: The following is about the best I can get
Thank you for your time and efforts :-) but unless you used some special
rendering options, when I rendered it the atmosphere is way too bright and the
sphere can still be distinctly seen through the media.

> clipka: You could use three independent media blocks, each one affecting only a
single colour channel
Maybe I do not understand what you mean, but this does not change the fact that
a constant density of 1 still allows seeing the sphere through the media. It is
not a matter of color itself, I can pretty much set any color I want, including
a color_map for the density, the object inside is always visible.

What I would probably need are densities higher than 1, or something that mimics
it. But since densities are looped in the 0-1 range, this is not possible with
the current implementation of density, unless I missed something...

More ideas welcome :-)

PS: this is a professional need, so unfortunately I cannot let go...


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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