POV-Ray : Newsgroups : povray.text.scene-files : faking light-bleed for a previous render Server Time
18 May 2024 11:32:04 EDT (-0400)
  faking light-bleed for a previous render (Message 1 to 1 of 1)  
From: Bob Hughes
Subject: faking light-bleed for a previous render
Date: 19 Jul 2005 14:56:13
Message: <42dd4ccd$1@news.povray.org>
// Persistence of Vision Ray Tracer Scene Description File
// File: light-bleed.pov; version 0.1
// Vers: 3.6
// Desc: a way to do light-bleed on a pre-made scene
// Date: 2005.5495
// Auth: Bob Hughes
// Note: The idea is to create light-bleeding by using a prior
//       rendering twice, once as itself and once with only
//       partial visible portions which are the brightest.
//       This bright part is randomly placed to effect a blur.
//       Concept acquired from Samuel T. Benge.
//       Use the following output name first (or previous file).
// cmd: +fn +Oc:\renderings\colorimage.png
//       And afterward use a different filename as output, like:
// cmd: +fn +Oc:\renderings\l-bimage.png
//       Caution: do not use the same output file names!


#version 3.6;

global_settings {
  assumed_gamma 1.0
}

#declare CreateImage=no; // say yes to render initial image file

// ----------------------------------------

#if (CreateImage=yes) // begin CreateImage directive

/* this would be your scene, which could be an #include instead */

camera {
  location  <0, 0, -3>
  look_at   <0, 0, 0>
}

light_source { // regular light
 <100,100,-100>, 1
}

light_source { // intensely bright
 <100,100,-100>, 3
 projected_through {box {<3,3,-3>,<3.3,3.3,-4>}}
}

sphere {
 0, 1
 texture {
  pigment {
   crackle form <1.25,0,0.25>
   scallop_wave turbulence 0.1 scale 0.1
   color_map {
    [0 color rgbf <0.97,0.65,0.0625>]
    [0.3 color rgbf <0.955,0.9525,0.05>]
    [0.7 color rgbf <0.45,0.95,0.5>]
    [1 color rgbf <0.0425,0.425,0.945>]
   }
  }
  normal {
   crackle -0.7 form <1.25,0,0.25>
   scallop_wave turbulence 0.1 scale 0.1
  }
  finish {
   specular 0.5 roughness 0.01
  }
 }
}

/* end example scene */

#else

/* begin light-bleeding part */

// not dependant on lights by using this
#default {finish {ambient 1 diffuse 0}}

#declare Im=
pigment {
 image_map {
  png "colorimage.png" // your scene, rendered prior to using
  interpolate 2
 }
}

#declare Ip=
texture {
 average
 texture_map {
  #local T=15; // iterate from this base number
  #local sX=seed(3214);
  #local sY=seed(2143);
  #while (T>0)
  #local rX=rand(sX);
  #local rY=rand(sY);
  [1
  pigment {
   image_pattern {
    png "colorimage.png" // again, your scene file
    interpolate 2
   }
   pigment_map {
    [2/3 color rgbt 1] // I guessed at this!
    [2/3 I] // you might want to make changes to the index values
   }
  translate <rX-0.5,rY-0.5,0> // this begins moving each iteration
  /  // divide the translation vector to reduce movement of images
  67 // this divisor value sets amount of light-bleed (adjust this)
  }
  ]
  #local T=T-1; //
  #end
 }
}

plane {
 z,3
 texture {
  average
  texture_map {
   [1 Ip] [1 Im] // combine the two images
  }
 translate -0.5 // center the image onto <0,0,0>
 scale <4,3,1> // scale it to fit render window
 } // end texture
} // end plane

#end // end CreateImage


Post a reply to this message

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