POV-Ray : Newsgroups : povray.general : Crepuscular rays/God Rays tips? : Re: Crepuscular rays/God Rays tips? Server Time
22 Feb 2025 03:36:35 EST (-0500)
  Re: Crepuscular rays/God Rays tips?  
From: Bald Eagle
Date: 17 Feb 2025 09:20:00
Message: <web.67b345772f4892fe1f9dae3025979125@news.povray.org>
So, I was playing with the basics of setting up the media for such a scene, and
although I could get the effect to generally work, I was puzzled by the fact
that no light came through the box that I was using as the sky/clouds - even
though I was using an rgbt pigment.
Light seemed to only come through the fully differenced holes.
It took me a bit of trial-and-error to get the media to look smooth, rather than
jaggy / layers of disks of light / or just not appearing when the camera looked
through the light at the horizon.


#version 3.7;
global_settings {assumed_gamma 1.0}
camera {
   location <0, 90, -500>
   look_at <0, 0, 0>
}

light_source {< 0, 500, 0> rgb 1000}

// Sky
sky_sphere {pigment {rgb 0.2}}

#declare M = 1;
#declare MM = 10;
// Cloud plane
difference {
 box {<-250, -0.02, -250>*MM, <250, 0.02, 250>*MM}
 // Cloud holes
 union {
  sphere { <-200, 0, -200>/M, 5}
  sphere { < 200, 0, -150>/M, 6}
  sphere { < 0.0, 0,  0.0>/M, 4}
  sphere { <-150, 0,  100>/M, 5}
  sphere { < 150, 0,  150>/M, 4}
  sphere { <-300, 0, -100>/M, 6}
  sphere { < 300, 0,   50>/M, 5}
  sphere { <-100, 0, -300>/M, 4}
  sphere { < 100, 0,  300>/M, 5}
  sphere { <-250, 0,  200>/M, 6}
  sphere { < 250, 0, -200>/M, 5}
  sphere { <- 50, 0,  250>/M, 4}
  sphere { <  50, 0, -250>/M, 5}
  sphere { <-175, 0, -175>/M, 4}
  sphere { < 175, 0,  175>/M, 6}
  sphere { <-225, 0,   75>/M, 5}
  sphere { < 225, 0, - 75>/M, 4}
  sphere { <- 75, 0, -225>/M, 5}
  sphere { <  75, 0,  225>/M, 6}
  sphere { <-125, 0,  175>/M, 5}
 }
 pigment {rgb y+z}
 #declare T = 0;
 texture {
  pigment {bozo turbulence 0.76
   color_map {
    [0.5 rgbft <0.20, 0.20, 1.00, T, 1>]
    [0.6 rgbft <1.00, 1.00, 1.00, T, 0.5>]
    [1.0 rgbft <0.50, 0.50, 0.50, T, 1>]
   }
  }
  scale 10
  finish {diffuse 1 emission 0.5}
 }
 translate y*100
}

#declare MM = 10;
box {
 <-270, -5, -270>*MM, <270, 5, 270>*MM
 pigment {rgbt 1}
 hollow
 interior {
  media {
   method 3
   density {rgb 0.0001}
   scattering {2, 1}

   samples 500
   //confidence 0.9999
   //variance 1/1000
   //ratio 0.9
  }
 }
 translate y*50
}

plane {y, 0
 pigment {rgb x+y*0.2}
}

plane { y, 0.1
        texture{ pigment{ color rgb<0.35,0.65,0.0>*0.9 }
          normal { bumps 0.75 scale 0.015 }
                 finish { phong 0.1 }
               } // end of texture
      } // end of plane


Post a reply to this message


Attachments:
Download 'crepuscularrays1.png' (332 KB)

Preview of image 'crepuscularrays1.png'
crepuscularrays1.png


 

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