POV-Ray : Newsgroups : povray.binaries.images : Transition between two medias Server Time
30 Jul 2024 14:17:17 EDT (-0400)
  Transition between two medias (Message 3 to 12 of 22)  
<<< Previous 2 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Christian Froeschlin
Subject: Re: Transition between two medias
Date: 24 Apr 2012 06:58:43
Message: <4f968763@news.povray.org>
Thomas de Groot wrote:

> I would prefer a more diffuse approach using a spherical pattern for 
> instance, but I am unable to come up with a working code that can do 
> that properly.

are you looking for something like this:

#declare f_gradient_x_non_repeating = function
{
   select(x,0,select(x-1,x-1,1))

   // of course you can also construct something using
   // f_spherical here depending on desired geometry
}

box
{
   <-2,-1,0>,<2,1,1> hollow
   pigment  {color rgbt 1}
   interior
   {
     media
     {
       method 3
       absorption 10
       density
       {
         function {f_gradient_x_non_repeating(x,y,z)}
         translate -0.5*x
         scale 2*x
         rotate 45*z
         color_map
         {
           [0.0 color Navy]
           [1.0 color Khaki]
         }
       }
     }
   }
}


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Transition between two medias
Date: 24 Apr 2012 07:01:05
Message: <4f9687f1$1@news.povray.org>
Christian Froeschlin wrote:

note you will need to media statements, one to increase
the scattering and another to decrease the absorption.


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Transition between two medias
Date: 24 Apr 2012 07:06:11
Message: <4f968923$1@news.povray.org>
Christian Froeschlin wrote:

>   select(x,0,select(x-1,x-1,1))

and that was actually supposed to be

select(x,0,select(x-1,x,1))


Post a reply to this message

From: Thomas de Groot
Subject: Re: Transition between two medias
Date: 24 Apr 2012 08:06:06
Message: <4f96972e@news.povray.org>
On 24-4-2012 12:58, Christian Froeschlin wrote:
> are you looking for something like this:
>
> #declare f_gradient_x_non_repeating = function
> {
> select(x,0,select(x-1,x-1,1))
>
> // of course you can also construct something using
> // f_spherical here depending on desired geometry
> }
>
> box
> {
> <-2,-1,0>,<2,1,1> hollow
> pigment {color rgbt 1}
> interior
> {
> media
> {
> method 3
> absorption 10
> density
> {
> function {f_gradient_x_non_repeating(x,y,z)}
> translate -0.5*x
> scale 2*x
> rotate 45*z
> color_map
> {
> [0.0 color Navy]
> [1.0 color Khaki]
> }
> }
> }
> }
> }
Thank you both, Le_Forgeron and Christian. I feel Le_Forgeron's solution 
to be rather complicated and I do not yet understand everything yet, 
although it might be the best approach in the end.

Christians solution is elegant and promises to be my favourite choice. 
Using my own water colours, and tweaking the code in the following way:

//=======================================================================
#declare Sea_col = srgb <0.51373, 0.70588, 0.70588>;   //clear water
#declare Mud_col = srgb <0.74118, 0.71765, 0.41961>+<0.2, 0.2, 0>; 
//muddy water
#declare Dist    = 200;  //determines the depth transparency of the 
water column

#local FD = -(Dist/(6*25.4))/ln(0.58);	//fade distance

#declare f_gradient_x_non_repeating = function {select(x,0,select(x-1,x,1))}

box {
   <-3,-1,-1>, <3,1,1>
   hollow
   pigment {color rgbt 1}
   finish {
     conserve_energy
     diffuse 0.2
     ambient 0
     reflection {0.01, 0.2 fresnel on metallic 0}
   }
   normal {crackle 0.15 scale <0.45,0.25,0.25>*2 turbulence 0.5 }
   interior {
     ior 1.33
     media {
       method 3
       absorption 5
       density {rgb 1/FD}
       //next commented out to follow original fading on line above
       /*density {
         function {f_gradient_x_non_repeating(x,y,z)}
         translate 0.25*x
         scale 2*x
         rotate 70*z
         color_map {
           [0.0 color Sea_col]
           [1.0 color Mud_col]
         }
       }*/
     }
     media {
       method 3
       scattering {3, Sea_col}
       density {
         function {f_gradient_x_non_repeating(x,y,z)}
         translate 0.25*x
         scale 1*x
         rotate 60*z
         color_map {
           [0.0 color Mud_col]
           [1.0 color Sea_col]
         }
       }
     }
   }
}
//=======================================================================

This is going in the right direction! I have see how to tweak the 
colours to obtain approximately my original water aspect.

Thomas


Post a reply to this message


Attachments:
Download 'mediatest2.png' (33 KB)

Preview of image 'mediatest2.png'
mediatest2.png


 

From: Thomas de Groot
Subject: Re: Transition between two medias
Date: 24 Apr 2012 08:15:23
Message: <4f96995b@news.povray.org>
On 24-4-2012 14:06, Thomas de Groot wrote:
>
> This is going in the right direction! I have see how to tweak the
> colours to obtain approximately my original water aspect.
>

Nice! Adding also some turbulence.

Thomas


Post a reply to this message


Attachments:
Download 'mediatest2.png' (34 KB)

Preview of image 'mediatest2.png'
mediatest2.png


 

From: Thomas de Groot
Subject: Re: Transition between two medias: Final result
Date: 25 Apr 2012 04:22:30
Message: <4f97b446@news.povray.org>
And this is the final result, as seen from a tower on the island 
offshore from Gancaloon.

Thanks Christian!

Thomas


Post a reply to this message


Attachments:
Download 'gancaloon.png' (607 KB)

Preview of image 'gancaloon.png'
gancaloon.png


 

From: Thomas de Groot
Subject: Re: Transition between two medias: Final result
Date: 25 Apr 2012 04:38:44
Message: <4f97b814@news.povray.org>
... and a view from the other side.

Thomas


Post a reply to this message


Attachments:
Download 'gancaloon.png' (993 KB)

Preview of image 'gancaloon.png'
gancaloon.png


 

From: Stephen
Subject: Re: Transition between two medias: Final result
Date: 25 Apr 2012 05:11:10
Message: <4f97bfae$1@news.povray.org>
On 25/04/2012 9:38 AM, Thomas de Groot wrote:
> .... and a view from the other side.
>
> Thomas
> .... and a view from the other side.
>
> Thomas
> .... and a view from the other side.
>
> Thomas

Is that the right image? The lower 3/5 is blank.

-- 
Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: Transition between two medias: Final result
Date: 25 Apr 2012 06:57:43
Message: <4f97d8a7$1@news.povray.org>
On 25-4-2012 11:11, Stephen wrote:
> On 25/04/2012 9:38 AM, Thomas de Groot wrote:
>> .... and a view from the other side.
>>
>> Thomas
>> .... and a view from the other side.
>>
>> Thomas
>> .... and a view from the other side.
>>
>> Thomas
>
> Is that the right image? The lower 3/5 is blank.
>

No problem from my side. 1200x675 being the image ratio.

Thomas


Post a reply to this message

From: Stephen
Subject: Re: Transition between two medias: Final result
Date: 25 Apr 2012 07:14:47
Message: <4f97dca7@news.povray.org>
On 25/04/2012 11:57 AM, Thomas de Groot wrote:
> On 25-4-2012 11:11, Stephen wrote:

>>
>> Is that the right image? The lower 3/5 is blank.
>>
>
> No problem from my side. 1200x675 being the image ratio.
>
> Thomas
>
It is Thunderbird again.
It gives me three images now, two of them partial the third is a full image.
I like this view it shows the silt to advantage.
The paths remind me of Rune's Grass Tex.
And when are we going to get a view of the white palace or temple?

-- 
Regards
     Stephen


Post a reply to this message

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

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