POV-Ray : Newsgroups : povray.advanced-users : Invisible Photon Mapping : Re: Invisible Photon Mapping Server Time
28 Sep 2024 18:38:54 EDT (-0400)
  Re: Invisible Photon Mapping  
From: Quartz
Date: 6 Sep 2011 23:40:00
Message: <web.4e66e661c559cf212b8e18870@news.povray.org>
Thank you all again. I have incorporated a custom function to work around
POV-Ray 3.6.1's radiosity bug, and to greatly improve both the quality and the
render speed. Here is what I've settled on for now, while I render it from
various angles to get a better sense of it:

-------

// Copyright (C) 2011 by Peter Markley.

#local sun_radius      =   40.00; // units in megameters
#local eith_orbt_rdus  = 3000.00; // eithalica's orbit radius
#local aphelion_offset =   20.00; // distance of ephelion from
                                  // otherwise circular orbit
#local eith_radius     =    6.53; // eithalica is the planet's name
#local eith_mass       = 6.40e24; // units in kilograms
#local eith_moon_dist  =    6.00; // dist @ closest point between
                                  // eithalica's & moon's surfaces
#local eith_moon_rdus  =    6.22; // moon radius
#local eith_moon_mass  = 5.55e24; // moon mass
#local eith_rotn_prod  =    4.70; // rotation period in hours
#local camr_dist       =    3.00; // multiplier for camera dist
#local eith_poso = radians(073);  // eithalica's orbital position
                                  // in radians counterclockwise
                                  // from positive x axis
#local eith_day  = (10/(141+1))*4.70;//(frame_number/(final_frame+1))*4.70;
                                  // eith's rotational position in
                                  // hours - one full turn every
                                  // multiple of 4.70

#local atmos_color    = <5.4e-2,1.8e-1,3.6e-1>; // color that is reflected
//#local atmos_twilight = 1-(1-<1.0,0.7,0.4>)*1.0; // color that is transmitted

#local eith_moon_posr = eith_radius+eith_moon_dist+eith_moon_rdus;
#local eith_rotn = (eith_day/eith_rotn_prod)*-360-degrees(eith_poso);
#local eith_posx =
cos(eith_poso)*(eith_orbt_rdus+aphelion_offset*0.5)-aphelion_offset*0.5;
#local eith_posz = sin(eith_poso)*eith_orbt_rdus;

camera
 {
 location <0,1,-0.1>*(eith_moon_posr+eith_moon_rdus)*(camr_dist+1.0) look_at 0
 right x*image_width/image_height
 rotate <0,eith_rotn,0>
 translate <eith_posx,0,eith_posz>
 angle 48
 }
light_source
 {
 0 color rgb 3.0
 /*looks_like
  {
  sphere
   {
   0,sun_radius
   texture {pigment {rgb 5} finish {ambient 1}}
   no_shadow
   }
  }*/
 }/*
sphere
 {
 0,1e2
 texture {pigment {rgbt <0,0,0,1>}}
 no_shadow
 hollow
 interior
  {
  media
   {
   emission <1.0e-2,5.0e-3,7.0e-4>
   intervals 1
   method 3
   samples 20
   }
  }
 }*/
sky_sphere {pigment {rgb <0,0,0>}}

global_settings
 {
 ambient_light 1.0
 radiosity {brightness 1.0 count 100 media on recursion_limit 20}
 max_trace_level 15
 }
#default {finish {ambient 0.0 diffuse 1.0}}

/*torus {eith_orbt_rdus,0.5 texture {pigment {rgb <1,0.3,0>} finish {ambient
1}}}
torus
 {
 eith_orbt_rdus,0.5 texture {pigment {rgb <1,1,0>} finish {ambient 1}}
 scale <(aphelion_offset*0.5+eith_orbt_rdus)/eith_orbt_rdus,1,1>
 translate <-aphelion_offset*0.5,0,0>
 }*/

#local eith_texture = texture
 {
 pigment {rgb <0,0,0.4>}
 finish {specular 0.7}
 normal {agate scale 1e-3}
 };
union
 {
 // eithalica
 union
  {
  sphere
   {
   0,eith_radius texture {eith_texture}
   texture {pigment {image_map {png "./eithalica_tex.png" map_type 1}}}
   photons {target reflection on refraction off}
   }
  sphere
   {
   0,eith_radius+8e-2
   texture {pigment {image_map {png "./eithalica_clouds.png" map_type 1}}}
   photons {target reflection on refraction off}
   hollow
   }
  }

 // temalar
 union
  {
  sphere
   {
   0,eith_moon_rdus texture {eith_texture}
   texture {pigment {image_map {png "./temalar_tex.png" map_type 1}}}
   photons {target reflection on refraction off}
   }
  sphere
   {
   0,eith_moon_rdus+8e-2
   texture {pigment {image_map {png "./temalar_clouds.png" map_type 1}}}
   photons {target reflection on refraction off}
   hollow
   }
  translate <eith_moon_posr,0,0>
  }

 // chessol
 union
  {
  sphere
   {
   0,eith_moon_rdus texture {eith_texture}
   texture {pigment {image_map {png "./chessol_tex.png" map_type 1}}}
   photons {target reflection on refraction off}
   }
  sphere
   {
   0,eith_moon_rdus+8e-2
   texture {pigment {image_map {png "./chessol_clouds.png" map_type 1}}}
   photons {target reflection on refraction off}
   hollow
   }
  translate <eith_moon_posr,0,0>
  rotate <0,-120,0>
  }

 // siothum
 union
  {
  sphere
   {
   0,eith_moon_rdus texture {eith_texture}
   texture {pigment {image_map {png "./siothum_tex.png" map_type 1}}}
   photons {target reflection on refraction off}
   }
  sphere
   {
   0,eith_moon_rdus+8e-2
   texture {pigment {image_map {png "./siothum_clouds.png" map_type 1}}}
   photons {target reflection on refraction off}
   hollow
   }
  translate <eith_moon_posr,0,0>
  rotate <0, 120,0>
  }
 //torus {eith_moon_posr,0.1 texture {pigment {rgb <1,1,0>} finish {ambient 1}}}

 #local mlef = -cos(radians(60))*eith_moon_posr;
 #local mrht = eith_moon_posr;
 #local mbot = -sin(radians(60))*eith_moon_posr;
 #local mtop = +sin(radians(60))*eith_moon_posr;
 //chessol = <left,0,top>;
 //siothum = <left,0,bottom>;
 //temalar = <right,0,0>;
 #local grav = 6.6738480e-29; // universal gravitational constant in cubic
megameters per (kilogram (seconds squared))
 #local maxi = 13e-6; // maximum expected acceleration in megameters per second
 #local mini = 7e-6; // acceleration threshold at which atmospheric density is
zero
 #local len = function(x,y,z) {sqrt(pow(x,2)+pow(y,2)+pow(z,2))}; // distance
formula

 sphere
  {
  0,eith_moon_posr+eith_moon_rdus*1.6 texture {pigment {rgbt <0,0,0,1>}}
  hollow
  interior
   {
   media
    {
    scattering {2, atmos_color extinction 1.6}
    density
     {
     average
     density_map
      {
      [0.25 function
       {
       1.0-min(1,1.0-(grav*eith_mass/pow(len(x,y,z),2)+
       grav*eith_moon_mass/pow(len(x-mlef,y-0.0,z-mtop),2)+
       grav*eith_moon_mass/pow(len(x-mlef,y-0.0,z-mbot),2)+
       grav*eith_moon_mass/pow(len(x-mrht,y-0.0,z-00.0),2)-mini)
       /(maxi-mini))
       }]
      [1.0 function
       {

(1.0-min(1,pow((sqrt(pow(x,2)+pow(y,2)+pow(z,2))-eith_radius)/(eith_radius*0.25),1/3)))+

(1.0-min(1,pow((sqrt(pow(x-mlef,2)+pow(y-0.0,2)+pow(z-mtop,2))-eith_moon_rdus)/(eith_moon_rdus*0.25),1/3)))+

(1.0-min(1,pow((sqrt(pow(x-mlef,2)+pow(y-0.0,2)+pow(z-mbot,2))-eith_moon_rdus)/(eith_moon_rdus*0.25),1/3)))+

(1.0-min(1,pow((sqrt(pow(x-mrht,2)+pow(y-0.0,2)+pow(z-00.0,2))-eith_moon_rdus)/(eith_moon_rdus*0.25),1/3)))
       }]
      }
     }
    intervals 1 method 3 samples 20
    }
   //fade_color atmos_twilight
   //fade_distance eith_moon_rdus*2.0
   //fade_power 2.0
   }
  }
 rotate <0,eith_rotn,0>
 translate <eith_posx,0,eith_posz>
 }


Post a reply to this message

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