POV-Ray : Newsgroups : povray.general : halo conversion question : halo conversion question Server Time
13 Aug 2024 19:21:35 EDT (-0400)
  halo conversion question  
From: Dan Connelly
Date: 12 Jul 1998 16:34:23
Message: <35A90FB6.42A30957@flash.net>
/**************************************************************
I apologize for all the questions, but I have been struggling
with making a fog of a decaying exponential density for some
time now.  And the issue of media has been brought up
by other posters.

I finally figured it out, I think, but within the halo
framework -- I can't figure out how to convert it into
3.1 compliance.  It looks as though my current project
will be in 3.02 TM unless I can figure out the conversion.

A halo solution is the following.  Note the exponential
behavior is effected through the transparancy channel of
the halo color map.

Any ideas on converting this into media?
********************************************************/

#version 3.0
#declare Camera_Location = <1.5, 0.7, -2>;

camera {
  location Camera_Location
  look_at <0, 0.5, 0>
}
light_source {
  Camera_Location
  color rgb 0.5
}
light_source {
  <-100, 100, -100>
  color rgb 0.5
}

box {
  <-0.5, 0, -0.5>,
  <0.5,  1, 0.5>
  hollow
  pigment { rgbf 1 }
  halo {
    attenuating
    planar_mapping
    linear
    max_value 1
    color_map {
      #declare Y = 0;
      #declare dY =0.05;
      #declare A = 5;
      #while (Y < 1 + dY/2)
        [Y rgbt <0, 1, 0, 1-exp(-A*(1-Y))>]
        #declare Y = Y + dY;
      #end
    }
  }
}

plane {
  y,
  0
  pigment {
    color rgb <1, 1, 1>
  }
}

sky_sphere {
  pigment { color rgb 1 }
}

/////////////////////////////////////////
// http://www.flash.net/~djconnel/


Post a reply to this message

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