POV-Ray : Newsgroups : povray.binaries.images : Re: Cloud Surface : Re: Cloud Surface Server Time
2 Jul 2024 21:34:54 EDT (-0400)
  Re: Cloud Surface  
From: omniverse
Date: 27 Nov 2017 17:15:00
Message: <web.5a1c8d859a2a53c19c5d6c810@news.povray.org>
Sven Littkowski <I### [at] SvenLittkowskiname> wrote:
> On 27.11.2017 07:20, Thomas de Groot wrote:
> > It depends of what you want. If it is a fading away of the clouds
> > towards the edge, you would need a cloud media using density
> > {cylindrical etc} to get the proper effect, in addition to the clouds
> > proper. Not entirely trivial to do, although I think it possible. I
> > shall try later when I get some time. Somewhat easier would be, I guess,
> > hiding the edge in a more opaque mist (also with cylindrical) but then
> > as an atmospheric effect. You know that you can layer media like you can
> > layer textures?
>
> Hi, thanks for your answer. I need both effects: fading cloud edges
> (density), and the distant fog that makes the cloud object disappearing
> at the horizon (please see the attached example image). It is actually
> that example scene, that triggered my decision to do something like that
> with POV-Ray. :-)

I used Thomas' scene to modify (maybe hack is the word) and had much trouble
with transparency of the media, especially when objects within it are backlit or
in shadow.

I finally got a result similar to the photo, but it took some serious trial and
error to get the colors. And I tried various extinction values, to name one
example. Just look at all the media color vectors and you will see what I mean.

I also used radiosity with it too, so I added sphere for ground. I had to widen
that to meet horizon edge better than simply have a shell of
cloud/fog/atmosphere, and sky disc of blue-white to try and make those cloud
colors interact with radiosity. Which was due to the reddened atmosphere,
otherwise it turned very yellow.

There was strange stuff about the atmosphere y-axis scale when changing index
values, but I shouldn't go into all that here. Just be forewarned that using
other index values might alter the haze layer (orange-yellow portion) in weird
ways. You will also notice I turned the media into spherical warps, and rotated
the atmosphere in attempt to get haze layer out of near distance.

Like I said, it's more a hack rather than modified with certainty of outcome.

I might be forgetting things, I was changing almost every aspect but luckily
Thomas got me to the starting point well enough. Scene follows:


//thomas de groot

//modified, bob

//cmd:+am2 +a0.1

//-------------------------------------------------------------
#version 3.8;

global_settings {
   assumed_gamma 1.4
   radiosity {media on}
}

#default {
  finish { ambient 0.0 diffuse 1.0 }
}

//------------------------------------------------------------------------
#include "colors.inc"
#include "textures.inc"
#include "glass.inc"
#include "metals.inc"
#include "golds.inc"
//------------------------------------------------------------------------

camera {
   /*ultra_wide_angle*/ //angle 20
   location  < -35.0 , 11.0 , 0.0 >
   //right     x*image_width/image_height // not needed for v3.8
   look_at   < 0.0 , 5.0 , 0.0 >
}

// sun -------------------------------------------------------------------
light_source {
   -z*9999//< 50, 100, -250 >*10e4
   color 1//< 1.0,  0.62353,  0.46667 >*2
   rotate <20,240,0> // altitude, azimuth, tilt
}

// sky -------------------------------------------------------------------
background { color rgb 0 }
/*
sky_sphere {
   pigment {
     gradient < 0, 1, 0 >
     color_map {
       [ 0.0 color rgb < 1.00000,  0.62353,  0.46667 > ] // Pink
       [ 0.4 color rgb < 0.64706,  0.30588,  0.59608 > ] // Purple
       [ 0.6 color rgb < 0.64706,  0.30588,  0.59608 > ] // Purple
       [ 1.0 color rgb < 1.00000,  0.62353,  0.46667 > ] // Pink
     }
     scale 2
   }
}
*/
disc {0,y,1,0 hollow on no_shadow pigment {rgb <0.5,0.75,1>} scale 100 translate
y*100}
/*
// ground -----------------------------------------------------------------
disc {
  < 0, 1, 0 >, 0, 50
  texture { pigment { color rgb < 0.24706,  0.38431,  0.058824 > *1.0 }
  finish {diffuse 1.0 } }
  rotate< 0, 0, 0 >
}
*/
sphere {
 0,1
 pigment {color rgb 1}
 scale <555,497,555>
 translate -y*494
}

//--------------------------------------------------------------------------
//---------------------------- objects in scene ----------------------------
#local Scale = 5;

#declare Clouds=
       density {
         ripples   // controls the cloud formation
         color_map {
           [0.33 rgb 10]
           [0.67 rgb 100]
         }
         scale <3, 1, 10>*0.5
         warp {turbulence <2.5, 1.0, 1.6>}
         rotate 45*y
       }

//cloud layer:
//cylinder {
//   < 0.0, 0.0, 0.0 > < 0.0, 0.45, 0.0 > 10.0
sphere {
 0, 1
   pigment {rgbt 1}
   hollow
   interior {
     media {
       samples 20
       absorption <3, 4, 0.5>*1/(Scale*100)
       emission <1.0, 1.0, 1.0>*0.5/(Scale*100)
       scattering {1, <0.5, 0.75, 1.5>*3/(Scale*100) extinction 0.5}//
eccentricity 0.2}
       density {
        spherical
        density_map {
         [0 rgb 0.0]
         [0.001 Clouds scale 1/100]
        }
       }
     }
     /*
     media {
       samples 33
       absorption <1.0, 1.0, 1.0>*10/(Scale*100)
      // emission <1.0, 1.0, 1.0>*0.1/(Scale*100)
       scattering {5, <1, 1, 1>*1.5/(Scale*100) extinction 1.0 eccentricity 0.2}
       density {
        spherical
        density_map {
         [0 rgb 0.0]
         [0.001 Clouds scale 1/100]
        }
       }
     }
     */
   }
   scale Scale*100
   translate -y*494
   //translate <0, 1, 0>
}

//-------------------------------------------------------------
//atmosphere:
sphere {
   <0.0, 0.0, 0.0 >, 1.0//10
   pigment {rgbt 1}
   hollow
   interior {
     media {
      samples 20
      absorption 0.5
       scattering {5, <1.25, 1, 1.5,>*2/Scale extinction 0.67 eccentricity 0.2}
       density {
         gradient y
         color_map {
           [0.00 rgb 1]  //base ground fog
           [0.1 rgb <9,0.3,0.1>]  //top ground fog
           [0.3 rgb <0.9,0.3,0.1>]  //top ground fog
           [0.5 rgb <0.5,0.1,0.09>*0.1] //base atmospheric haze
           [0.67 rgb <0.1,0.2,0.9>*0.1] //top atmospheric haze
           [1.00 rgb <0.1,0.3,0.9>*0.001] //top atmospheric haze
         }
         rotate -x*15
         warp {spherical}
         scale Scale*2*y
       }
     }
   }
   //scale Scale
   scale Scale*111
   translate -y*535
}
/*
//-------------------------------------------------------------
//artefact:
union {
   cylinder {< 0.0, 0.0, 0.0 > < 0.0, 8.0, 0.0 > 0.25}
   sphere {< 0.0, 8.0, 0.0 > 0.25}
   texture { T01 }
   texture { T_Copper_1A }
}
*/
//-------------------------------------------------------------
// Planet:
union {
   sphere {
     <0.0, 0.0, 0.0> 7.0
   }
   difference {
     cylinder { < 0.0, -0.00001, 0.0 > < 0.0, 0.00001, 0.0 > 20.0 }
     cylinder { < 0.0, -0.00002, 0.0 > < 0.0, 0.00002, 0.0 > 10.0 }
   }
   texture {pigment {color rgb 1}}
   scale 33
   rotate < 20.0, -10.0, 4.0 >
   translate <80.0, -2.0, 13.0>*33
}

//-------------------------------------------------------------
//buildings:
#local S=seed(4132);
union {
#for (It,1,8,1)

#local xR=rand(S);
#local yR=rand(S);
#local zR=rand(S);

#local xR2=rand(S);
#local yR2=rand(S);
#local zR2=rand(S);

box {
 0,1
 scale <1+xR,8+yR*4,1+zR>/2
 pigment {
  checker
  color rgb 0.1 color rgb 0.9 scale 0.5
 }
 translate (-<xR*20,0,zR*20>+<xR2*40,0,zR2*40>)/2
}
#end
 rotate y*90
 translate <-20,2,5>
}


Post a reply to this message


Attachments:
Download 'test fog cloud.png' (121 KB)

Preview of image 'test fog cloud.png'
test fog cloud.png


 

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