File:Terraplan6.png

Original file(1,600 × 1,200 pixels, file size: 1,004 KB, MIME type: image/png)

Captions

Captions

Fictional terrestric, Earth-Like exoplanet

Summary edit

Description
English: Fictional terrestric, Earth-Like exoplanet. P
Date
Source Own work
Author Merikanto

Pov_ray source code

// pov-ray planet: rigded multifractal, isosurfece attempt, atmosphere

  1. include "colors.inc"
  2. include "consts.inc"
  3. include "functions.inc"


global_settings {

    #if (version < 3.7) assumed_gamma 1 #end
    max_trace_level 20

}


default { finish { ambient 0.000002 diffuse 0.000001 reflection 0.0 } }      
     
     

// Units

  1. declare m = 0.1; // A value of 1 makes the sun's distance ouside POV's numerical domain.
  2. declare km = 1000*m;
  3. declare mm = 0.001*m;

// ------------- // -- | Parameters | ------ // ------------- // Earth parameters

  1. declare TP_EARTH_RADIUS = 6378.137*km;

// Sun parameters

  1. declare TP_SUN_HEADING = 10;
  2. declare TP_SUN_ELEVATION = 30;
  1. declare TP_BRIGHTNESS = 1;
  2. declare TP_SUN_COLOR = White;
  3. declare TP_SUN_APPARENT_APERTURE = 0.5; // Commonly admitted value

// Atmosphere parameters

  1. declare TP_ATMO_BOTTOM = -1*m;
  1. declare TP_RAYLEIGH_FACTOR = 1;
  2. declare TP_RAYLEIGH_DENSITY_MAX = 1;
  3. declare TP_RAYLEIGH_AMOUNT = 1;
  1. declare TP_ATMO_INTERVALS = 3; // Necessary for good integration
  2. declare TP_ATMO_SAMPLES = 3;
  3. declare TP_ATMO_METHOD = 3; // Adaptive

// Default camera parameters

  1. declare TP_DEFCAM_HEIGHT = 2*m; // Let's be tall
  2. declare TP_DEFCAM_HEADING = 0;
  3. declare TP_DEFCAM_ELEVATION = 5; // Let's look up a little
  4. declare TP_DEFCAM_ANGLE = 40;
 /*

// Earth

  1. declare _tp_earth = sphere

{

    0, TP_EARTH_RADIUS
   // pigment {White} // Could be any predefined texture, but normally, the  terrain hides the sphere


               pigment {
           
      //     color rgb <0.9294, 0.7882,0.6863>*0.1
        //   color rgb   <0.9686, 0.8784,0.6627>
       
          
          function {
             
             f_hetero_mf(x,y,z, 0.9, 1.7,12, 0.5, 0.9, 3 )
           //  f_hetero_mf(x/1000,y/1000,z/1000, 0.9, 1.7, 12, 0.5,0.9, 3 )
       //   f_noise3d(x/200,y/200,z/200)
        //      f_ridge(x/500, y/500, z/500, 1, 8, 1, 3,1,1)  
        
       //    f_ridged_mf(x/1000, y/1000, z/1000, 0.5, 4, 13, 3, 5, 1)*-1
          }
          
           scale TP_EARTH_RADIUS
      //  agate
        //  granite
        //  scale 3
          octaves 14
        pigment_map 
        {  
                [0.0 color rgb <0.0,0.6,0.2>/5   ]
           // [0.5 color rgb <0.9,0.8,0.7>   ] 
                 [0.5 colour rgb <216, 137, 105>/128 ]
          
            [0.51 color rgb <0.0,0.0,0.3>   ]      
        [1.0 color rgb <0.0,0.0,0.20>   ]  
  
      
     
          
      
        }
          
     //    Desert0
  //        scale 4
     
          } // ... pigment
          
          
          
          normal {
          
           function {
                    f_hetero_mf(x,y,z, 0.9, 1.7,12, 0.5, 0.9, 3 ) *0.5
         
         //     f_ridged_mf(x/1000, y/1000, z/1000, 0.5, 4, 13, 3, 5, 1)*-1
           }                                         
           
                      scale TP_EARTH_RADIUS    
                      
                    bump_size 2  
      //  agate
        //  granite
        //  scale 3
          octaves 14
           
           
          }
          
             
             
         
         
         
             
             
       
       
            finish {
               reflection 0.1
               diffuse 0.2
            //   specular 0.05  
             //  phong 0.05
         }    
               
             
             
      rotate y*180
    
  //  translate -TP_EARTH_RADIUS*y    
    
    

}

  • /
  1. declare fn_Pigm=function {
   pigment {
 //    granite  
 function {
   //  f_hetero_mf(x,y,z, 0.9, 1.7,12, 0.5, 0.9, 3 ) *0.5
       f_ridged_mf(x/1000, y/1000, z/1000, 0.5, 4, 13, 3, 5, 1)*-1
     }
     color_map {
       [0 color rgb 0]
       [1 color rgb 1]
     }
   }
 }
  1. declare _tp_earth = object {
   isosurface {
       
       function {
           f_sphere(x, y, z, 1) -
           fn_Pigm(x, y, z).gray*0.0001
           }
       
       }    
   
   pigment {
   //    color rgb <0,0.35,0>      
         
               function {
        //   f_sphere(x, y, z, 1) -
           fn_Pigm(x, y, z).gray
           }  
                 pigment_map 
        {  
                [0.0 color rgb <0.0,0.6,0.2>/5   ]
           // [0.5 color rgb <0.9,0.8,0.7>   ] 
                 [0.5 colour rgb <216, 137, 105>/128 ]
          
            [0.51 color rgb <0.0,0.0,0.3>   ]      
        [1.0 color rgb <0.0,0.0,0.20>   ]  
  
      
     
          
      
        }
   
       }
   
    
   finish {  
   diffuse 0.9
//   ambient 1
 //  emission 1
   } 
   
   scale  TP_EARTH_RADIUS
     

}

// Sun

  1. declare TP_SUN_DISTANCE = 10*TP_EARTH_RADIUS; // Far enough. Actual distance in the scene is not very critical, as the light ays are parallel
  2. declare TP_SUN_RADIUS =

TP_SUN_DISTANCE*tan(radians(TP_SUN_APPARENT_APERTURE/2));

  1. declare _tp_basic_sun = light_source

{

  <0, 0, 0>
  color rgb TP_SUN_COLOR*TP_BRIGHTNESS
  looks_like {sphere{0, TP_SUN_RADIUS pigment{Yellow} finish {diffuse 0  

ambient 1}}}

  translate TP_SUN_DISTANCE*z
  parallel point_at -z
  rotate -TP_SUN_ELEVATION*x
  rotate TP_SUN_HEADING*y

}

// Atmosphere: density

  1. declare TP_BASE_RAYLEIGH_POWER = 6.7; // Constant
  2. declare _tp_rayleigh_power = TP_BASE_RAYLEIGH_POWER*TP_RAYLEIGH_FACTOR;

//#declare TP_ATMO_THICKNESS = 50*km;

  1. declare TP_ATMO_THICKNESS = 150*km;
  1. declare _tp_rayleigh_density = density

{

    function
    {
       

//TP_RAYLEIGH_DENSITY_MAX*exp(-_tp_rayleigh_power*(sqrt(x*x+(y+TP_EARTH_RADIUS)*(y+TP_EARTH_RADIUS)+z*z)

//- TP_EARTH_RADIUS - TP_ATMO_BOTTOM)/TP_ATMO_THICKNESS)

TP_RAYLEIGH_DENSITY_MAX*exp(-_tp_rayleigh_power*(sqrt(x*x+(y)*(y)+z*z)

- TP_EARTH_RADIUS - TP_ATMO_BOTTOM)/TP_ATMO_THICKNESS)

    }

}

// Atmosphere: scattering color

  1. declare TP_LAMBDA_RED = 650; // nanometres
  2. declare TP_LAMBDA_GREEN = 555; // nanometres
  3. declare TP_LAMBDA_BLUE = 460; // nanometres
  4. declare TP_RAYLEIGH_SCATTERING_COLOR = rgb

<pow(TP_LAMBDA_BLUE/TP_LAMBDA_RED, 4), pow(TP_LAMBDA_BLUE/TP_LAMBDA_GREEN, 4), 1>;

// Atmosphere: media

  1. declare _tp_rayleigh_media = media

{

    method TP_ATMO_METHOD
    intervals TP_ATMO_INTERVALS
    samples TP_ATMO_SAMPLES
    scattering
    {

RAYLEIGH_SCATTERING color TP_RAYLEIGH_AMOUNT*TP_RAYLEIGH_SCATTERING_COLOR/TP_ATMO_THICKNESS extinction 1 // The only physically accurate value

    }
    density {_tp_rayleigh_density}

}

// Atmosphere: shell

  1. declare _tp_rayleigh_atmosphere = difference

{

    sphere {0, TP_EARTH_RADIUS + TP_ATMO_BOTTOM + TP_ATMO_THICKNESS  

//translate -TP_EARTH_RADIUS*y }

    sphere {0, TP_EARTH_RADIUS + TP_ATMO_BOTTOM 
    

// translate //-TP_EARTH_RADIUS*y

}

    hollow
    pigment {rgbt 1}
    interior {media{_tp_rayleigh_media}}

}

// Default camera

  1. declare _tp_default_camera = camera

{

    location 0
    angle TP_DEFCAM_ANGLE
    right     x*image_width/image_height
    look_at   z
    rotate -TP_DEFCAM_ELEVATION*x
    rotate TP_DEFCAM_HEADING*y
    translate TP_DEFCAM_HEIGHT*y // Could use trace() to make sure we are  above the surface. But no terrain yet ...

}



 #declare Clouds3x = pigment {
   //marble
   dents
   turbulence 6  
   octaves 32
   lambda 4
  // omega 0.75  
  scale 10   
   
   color_map {
          [0.0 color White*1.5 filter 0]
     [0.05 color White filter 1 ]
      [0.95 color White filter 1 ]
     [1.0 color White*1.4 filter 0]
     
   }
 } 
 


 #declare CloudArea = texture {
   pigment {
     gradient y  
    //   onion
//     sine_wave
  
    turbulence 3  
    octaves 15   
    scale 1    
    
    //lambda 2
   // omega 2
    
    scale 5
     //scale 0.2
      
   //  scale <10,10,10>
     
     pigment_map {  
        
        [0.00 Clouds3x scale 0.1]
       
    //         [0.00 Clouds3 scale 1]
      [0.2 Clouds3x]
       [0.50 Clouds3x scale 0.01]
       [0.8 Clouds3x scale 1]
       [1.00 Clouds3x scale 0.5]
     
       


     }
   }
 
 
  finish { 
  ambient 0.000002
   
  diffuse 0.9
  phong 0.1
  specular 0.05
 reflection 0.1
  
  }
 
 
 } 
  


  1. declare CloudsLayer1 = sphere
  {
   0, 1.001
 
   texture {
      CloudArea
   }
 
  }    
  


//sun


object {_tp_basic_sun}

// planet union {

object {_tp_earth rotate x*45 }

object {_tp_rayleigh_atmosphere}


object {CloudsLayer1 scale 1.00001*TP_EARTH_RADIUS }


rotate y*-90 }



//camera {_tp_default_camera}


camera {

location <1,1,0>*1200000 look_at <0,0,0> // look_at <0,-TP_EARTH_RADIUS,0>

}

Licensing edit

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current12:05, 15 September 2022Thumbnail for version as of 12:05, 15 September 20221,600 × 1,200 (1,004 KB)Merikanto (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata