POV-Ray : Newsgroups : povray.binaries.images : Radiosity/no_image : Re: Radiosity/no_image Server Time
2 Nov 2024 16:13:18 EDT (-0400)
  Re: Radiosity/no_image  
From: Dave Blandston
Date: 16 Jun 2010 05:40:00
Message: <web.4c189ad3bdfe36ccba3fb0f0@news.povray.org>
Here's a simple demo scene to illustrate what's going on. I made it to
experiment with but since it's completed I'll go ahead and post it.
---------------------------------------

#local HideExtrusion = yes;
//Note the difference in the interior (blue) portions
//when the extrusion is hidden (no_image, no_reflection)
//compared to when it's not hidden. When the extrusion
//is hidden, it still has a radiosity effect on the "I,"
//but not on the "L." When it's not hidden, it has a
//radiosity effect on both letters.

global_settings {
   max_trace_level 20
   radiosity {
      count 300
      error_bound .02
      nearest_count 16
      adc_bailout .1
      pretrace_start .08
      pretrace_end .004
      recursion_limit 2
   } //radiosity
} //global_settings

#include "colors.inc"
#include "metals.inc"

camera {
   location <0, 0, -20>
   direction <0, 0, 4/3>
   look_at <0, 0, 0>
   rotate -20 * x
} //camera

#local Dome = object {
   difference {
      sphere {0, 20001}
      sphere {0, 20000}
   } //difference
   texture {
      pigment {
         gradient z
         color_map {
            [0 color White * 7]
            [.4 color Black]
            [1 color Black]
         } //color_map
      } //pigment
      finish {ambient 1 diffuse 0}
      scale <1, 1, 20000>
   } //texture
   no_reflection
   no_shadow
} //object

object {Dome}

#local OuterColor = texture {pigment {color DarkOrchid}}
#local InnerColor = texture {T_Gold_5E}
#local LogoColor = texture {pigment {color SkyBlue}}

#macro CreateLogo (BorderWidth)

   #local L_ = object {
      difference {
         box {<BorderWidth, BorderWidth, 0> <3.55 - BorderWidth, 5.8 -
BorderWidth, 1>}
         box {<1.65 - BorderWidth, 1.9 - BorderWidth, -.1> <3.7, 5.9, 1.1>}
      } //difference
   } //object

   #local I_ = object {
      box {<BorderWidth, BorderWidth, 0> <1.8 - BorderWidth, 5.8 - BorderWidth,
1>}
   } //object

   union {
      object {L_}
      object {I_ translate 3.8 * x}
   } //union

#end //#macro CreateLogo

#local LogoDepth = 2; //Depth of the entire logo
#local BorderWidth = .2; //Width of the visible border and the invisible
extrusion.
#local BorderDepth = .36; //Depth of the visible border.
#local RadiosityExtensionDepth = .8; //Depth of the invisible extrusion, and
hence the amount of radiosity enhancement.

//The visible logo:
#local LOGO1 = object {
   CreateLogo (0)
   scale <1, 1, LogoDepth>
   texture {OuterColor}
} //object

#local LOGO2 = object {
   CreateLogo (BorderWidth)
   scale <1, 1, 1.1>
} //object

#local LOGO2 = object {
   intersection {
      object {LOGO2 texture {InnerColor}}
      plane {z, 1 texture {LogoColor}}
   } //intersection
   translate (-1 + BorderDepth) * z
} //object

#local LOGO = object {
   difference {
      object {LOGO1}
      object {LOGO2}
   } //difference
} //object

//Now for the invisible extrusion:
#local LOGO1 = object {
   CreateLogo (0)
} //object

#local LOGO2 = object {
   CreateLogo (BorderWidth)
   scale <1, 1, 1.2>
   translate -.1 * z
} //object

#local LOGO1 = object {
   difference {
      object {LOGO1}
      object {LOGO2}
   } //difference
   translate -1 * z
   scale <1, 1, RadiosityExtensionDepth>
   texture {pigment {color Red}} //Contrasting color for ease of de-bugging.
   #if (HideExtrusion)
      no_image
      no_reflection
   #end //#if
} //object

//Combine the visible logo and the invisible extrusion:
#local LOGO = object {
   union {
      object {LOGO}
      object {LOGO1 translate -.0001 * z}
   } //union
   no_shadow
} //object

object {LOGO translate <0, -2, -LogoDepth>}

plane {z, .8 inverse pigment {color DarkOliveGreen}}


Post a reply to this message

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