POV-Ray : Newsgroups : povray.beta-test : Photons are broken with true inverse squared lighting : Photons are broken with true inverse squared lighting Server Time
18 Jul 2024 08:03:08 EDT (-0400)
  Photons are broken with true inverse squared lighting  
From: Cousin Ricky
Date: 19 Jun 2024 15:14:18
Message: <66732e0a@news.povray.org>
https://news.povray.org/povray.binaries.images/thread/%3C65c7ec42%40news.povray.org%3E/

Well, I found out why my 30th anniversary tribute to POV-Ray went crazy
when I upgraded the lamp fixtures: photons are broken with POV-Ray 3.8's
inverse squared lighting.  I rendered my initial scene before I had
finished the DeskLamp module, and at that time, the scene used only
POV-Ray's legacy light fading; but the DeskLamp module automatically
uses true inverse squared if it detects #version 3.8 or later.

The 2 control images below were rendered without photons, just to verify
that the legacy light source and true inverse squared light source are
comparable.

---%<----%<----%<----%<--[BEGIN CODE]--%<----%<----%<----%<----%<---
// +KFF4 +W512 +H384
#version 3.8;

#declare Has_photons = (frame_number >= 3);
#declare True_invsq = 1 - mod (frame_number, 2);

#include "screen.inc"

global_settings
{ assumed_gamma 1
  max_trace_level 100
  #if (Has_photons)
    photons { spacing 0.005 autostop 0 }
  #end
}
#default { finish { ambient 0.1 diffuse 0.6 emission 0 } }
box
{ -<6, 0.001, 6>, <6, 8, 6>
  hollow
  pigment { rgb 1 }
}
Set_Camera (<2, 3, -5>, <0.25, 1, 0>, 60)

#declare v_Source = <-5, 7, -5>;
#declare v_Focus = <0, 1, 0>;
#declare Dist = vlength (v_Source - v_Focus);
#if (True_invsq)
  light_source
  { v_Source, rgb pow (Dist, 2)
    fade_distance 0
    fade_power 2
  }
#else
  #declare FD = 0.1;
  light_source
  { v_Source, rgb (1 + pow (Dist / FD, 2)) / 2
    fade_distance FD
    fade_power 2
  }
#end

intersection
{ box { -1, 1 }
  box { -1.1, 1.1 rotate 45 * x }
  box { -1.1, 1.1 rotate 45 * y }
  box { -1.1, 1.1 rotate 45 * z }
  translate y
  pigment { rgbf 1 }
  finish
  { fresnel 1
    reflection { 1 fresnel } conserve_energy
    specular 1 roughness 0.0003
  }
  interior { ior 1.8 dispersion 1.04 }
  photons { target collect off reflection on refraction on }
}

Screen_Object
( text
  { ttf "cyrvetic"
    concat
    ( #if (True_invsq) "True inverse squared",
      #else "Old fade formula",
      #end
      #if (Has_photons) " with photons"
      #else " control"
      #end
    )
    0.001, 0
    pigment { rgb 0 }
    scale 16 / image_height
  },
  <0, 0>, <0.02, 0.01>, yes, 1
)
--->%---->%---->%---->%---[END CODE]--->%---->%---->%---->%----%<---


Post a reply to this message


Attachments:
Download 'invsq_photons1.jpg' (19 KB) Download 'invsq_photons2.jpg' (19 KB) Download 'invsq_photons3.jpg' (26 KB) Download 'invsq_photons4.jpg' (37 KB)

Preview of image 'invsq_photons1.jpg'
invsq_photons1.jpg

Preview of image 'invsq_photons2.jpg'
invsq_photons2.jpg

Preview of image 'invsq_photons3.jpg'
invsq_photons3.jpg

Preview of image 'invsq_photons4.jpg'
invsq_photons4.jpg


 

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