POV-Ray : Newsgroups : povray.general : Object inside opaque media Server Time
6 May 2024 04:40:49 EDT (-0400)
  Object inside opaque media (Message 7 to 16 of 26)  
<<< Previous 6 Messages Goto Latest 10 Messages Next 10 Messages >>>
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

From: Thomas de Groot
Subject: Re: Object inside opaque media
Date: 11 Nov 2018 11:43:11
Message: <5be85c1f$1@news.povray.org>
On 11-11-2018 15:26, Shuffle wrote:
> 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.
> 
> 
>> 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.
> 

> More ideas welcome :-)
> 
> PS: this is a professional need, so unfortunately I cannot let go...
> 
> 

I have been thinking since. In RL, atmosphere is always more or less 
transparent. What you need is a second media to simulate a cloud layer. 
I shall look into that tomorrow.

-- 
Thomas


Post a reply to this message

From: Bald Eagle
Subject: Re: Object inside opaque media
Date: 11 Nov 2018 12:35:06
Message: <web.5be86811ddef308a765e06870@news.povray.org>
"Shuffle" <shu### [at] gmailcom> wrote:

> > Bald Eagle: Have a look at:
http://news.povray.org/povray.binaries.animations/thread/%3Cweb.5b32f0c22078c5ce458c7af
e0
> %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.

The purpose there was to show how you can use 3 different functions to control
the color, by having a separate function for r, g, and b, and then adding them
together.

> 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.

> 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.

YES.

>But since densities are looped in the 0-1 range, this is not possible with
> the current implementation of density, unless I missed something...

Don't count me as an expert - media can be, and usually is, a complicated thing
to use, especially properly/accurately.

http://www.povray.org/documentation/view/3.6.1/413/

"Imagine media as a density of particles, you specify 100 particles per cubic
pov-unit. If we scale a 1 cubic pov-unit object to be twice as big in every
direction, we will have a total of 800 particles in the object. The object will
look different, as we have more particles to look through. Yet the objects
density is still 100 particles per cubic pov-unit. In media this "particle
density" is set by the color after emission, absorption, or in the scattering
statement"

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

I think what you need to do is a calibration scene, much like doing a
calibration exposure in the Zone System for making black & white prints.

Stretch a box across the screen, and define a wedge shape to hold your media.
That way you go from 0 - 100% in terms of "obscurement".
Then you can fiddle with the "density" of the media to find out at what point
you can no longer see through it.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Object inside opaque media
Date: 11 Nov 2018 12:44:39
Message: <5be86a87$1@news.povray.org>
On 11-11-2018 17:43, Thomas de Groot wrote:
> On 11-11-2018 15:26, Shuffle wrote:
>> 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.
>>
>>
>>> 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.
>>
> 
>> More ideas welcome :-)
>>
>> PS: this is a professional need, so unfortunately I cannot let go...
>>
>>
> 
> I have been thinking since. In RL, atmosphere is always more or less 
> transparent. What you need is a second media to simulate a cloud layer. 
> I shall look into that tomorrow.
> 

Faster than light ;-)

I include a scene with a cloud layer. Please play around with 
MediaScale1 and MediaScale2 as those determine the aspect/thickness of 
the media.

I do not use any special rendering options. See image in p.b.i.

-- 
Thomas


Post a reply to this message


Attachments:
Download 'planet media_test.pov.txt' (3 KB)

From: clipka
Subject: Re: Object inside opaque media
Date: 11 Nov 2018 15:14:12
Message: <5be88d94$1@news.povray.org>
Am 11.11.2018 um 15:26 schrieb Shuffle:

> 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.

Technically, that's actually not true: The reason that you cannot see 
objects in dense fog is not because the light is absorbed completely - 
the light from the object falls off logarithmically, so at any finite 
distance you'll still get a finite non-zero portion of direct light from 
the object.

The reason you cannot see objects in dense fog is because the object's 
light gets too dim compared to scattered light.

>> 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.

You may have to crank up the absorption even more.

If even madly high values give you no success, there may be an issue 
with the sampling of the media; so toying with the quality settings may 
also be worth a try.


> 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...

Cranking up the colour values is what you want.


Post a reply to this message

From: Bald Eagle
Subject: Re: Object inside opaque media
Date: 11 Nov 2018 15:45:00
Message: <web.5be89453ddef308a765e06870@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> I think what you need to do is a calibration scene, much like doing a
> calibration exposure in the Zone System for making black & white prints.

Here's something along the lines of what I was thinking, just to show the
concept. I haven't altered the media parameters (as Alain will point out) from
the example in the wiki, except for changing it to absorption of red x 10




#version 3.8;
global_settings {assumed_gamma 1.0}

#include "colors.inc"

camera {
 location <0, 0, -12.0>
 look_at 0
 //angle 30
}

light_source {<0, 2, -20> White}

#declare Container_T= texture {
   pigment {rgbt <1,1,1,1>}
   finish {ambient 0 diffuse 0}
}

#declare Scale=2;
// linear prism in y-direction: from .. ,to ..,number of points (first = last)
prism { -1.00,  1.00 , 4
       <-5.00,  0.00>, // first point
       <-5.00, -1.00>,
       < 5.00,  0.00>,
       <-5.00,  0.00>  // last point = first point !!!

   hollow
   texture {Container_T}
   interior {
      media {
         intervals 1
         samples 1,1
         absorption <10, 0, 0>
      }
   }
   translate <-2.1,0,0>
}



box {<-8, -1, 0.5>, <8, 1, 1> pigment {Red}}


Post a reply to this message

From: clipka
Subject: Re: Object inside opaque media
Date: 11 Nov 2018 16:08:59
Message: <5be89a6b@news.povray.org>
Am 08.11.2018 um 17:02 schrieb Shuffle:

> 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

I've only found time now to completely read your original post.

I can guarantee you that in order to achieve what you're shooting for 
you /will/ have to cheat.

POV-Ray provides two mechanisms to deal with scattering material:

- The older mechanism, "media", only creates realistic results for cases 
where the mean free distance (the average distance a light ray travels 
before being scattered or absorbed) is larger than the distance between 
camera and object. (*)

- The newer mechanism, "subsurface light transport", only creates 
realistic results for cases where the mean free distance is 
significantly smaller than the dimensions involved. (Besides, it 
requires the material to have a clear-cut surface.)

In a camera dive into the atmosphere of a densely clouded planet down to 
the surface, you are transitioning from the regime where the mean free 
distance is comparatively small to the regime where it is comparatively 
large.


The easiest solution is probably to create two entirely separate 
animation sequences: One that takes you from orbit into dense atmosphere 
(with the planet invisible), and another one that takes you from dense 
atmosphere down to the surface (with the sky invisible).

The trick then will be to match the colour of the first animation's last 
frame to the second animation's first frame - or simply do a slow fade 
between the two animations.


(*) The problem is not so much that you can't use scattering media to 
obscure objects inside it - you can, all you have to do is crank up the 
density / colour high enough. The true problem is the scattering effect, 
which will go bonkers at such high settings, even if you mess with the 
extinction setting and/or add extra absorbing media.


Post a reply to this message

<<< Previous 6 Messages Goto Latest 10 Messages Next 10 Messages >>>

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