POV-Ray : Newsgroups : povray.beta-test : [bug]: radiosity sampling, with fix method. : [bug]: radiosity sampling, with fix method. Server Time
30 Jul 2024 18:16:24 EDT (-0400)
  [bug]: radiosity sampling, with fix method.  
From: Michael Andrews
Date: 11 Oct 2001 09:36:36
Message: <3BC5A13E.9C022BD6@reading.ac.uk>
I was building a scene to play with Kari Kivisalo's more accurate light
source ideas (as on his 'dynamic range compression' page) when I hit
a(nother) radiosity quirk. Fortunately I'd found a fix for it before I
found the bug!!

This is actually the bug that I thought my previous bug report was
finding: because the radiosity sample counter is reset to the start
every time, sampling artifacts are produced.

To show this I've posted two images in p.b-t.b: the first is with
WinPoV-Ray v3.5b6, the second is with a modified MegaPoV compile. The
vertical shadings on the wall by the light pannel and the fan shadings
on the floor in the v3.5 image are caused by the 'bug'.

The fix is easy: put in another count variable in ra_gather which is
either (local) static or randomly set on entry and incremented in the
sampling loop. Using this to index the rad_samples array removes the
sampling bias.

I'll append the scene file to this message.

Bye for now,
	Mike Andrews.

//#version unofficial MegaPov 0.7;

// +w320 +h240 +a0.3

global_settings { 
  max_trace_level 5
  assumed_gamma 1
  ambient_light 1
  adc_bailout 0
#if(1)
//  ini_option "+QR"
  radiosity {
    pretrace_start 8/image_width
    pretrace_end   4/image_width
    error_bound 0.1
    low_error_factor 0.1
    count 183
    recursion_limit 1
  }
#end
}                                                                       

camera {
  location  <4.0, 1.65, -4.5>
  direction z  
  right     x*image_width/image_height
  look_at   <3.5,1,-2> 
}

box { 0, <5,5,-5> inverse
  pigment { rgb 0.8 }
  finish { ambient 0 diffuse 0.7 specular 0.2 }
}

#declare C = 0; #while (C < 3)
  box { 0, 1
    pigment {
      planar 
      rotate 90*x 
      colour_map {
        [0.1 rgb vaxis_rotate(<.9,.3,.3>, 1, C*120)]
        [0.1 rgb 1]
      } 
    }
    finish { ambient 0 diffuse 0.6 specular 0.2 }
    translate -(x+z)/2
    scale <0.2,1.5,0.01>
    translate <2.1+C*0.4,0,-2>
  }
#declare C = C + 1; #end

#declare C = 0; #while (C < 4)
  box { 0, 1
    pigment { rgb 1 }
    finish { ambient 0 diffuse 0.8 specular 0.2 }
    translate -(x+z)/2
    scale <0.2,2.5,0.01>
    translate <1.9+C*0.4,0,-1.7>
  }
#declare C = C + 1; #end

#declare sX = 1;
#declare sY = 1;
#declare N = 2;
#declare cL = <2.5,1.5,-0.005>; 

box { -<sX/2,sY/2,0.01>, <sX/2,sY/2,0.01>
  pigment { rgb 1 }
  finish { ambient 1 diffuse 0 }
  translate <cL.x,cL.y,0>
  no_shadow
}

#declare C1 = 0; #while (C1 < N)
  #declare C2 = 0; #while (C2 < N)
    light_source {
      0, rgb 10
      area_light x*sX/N, y*sY/N, 4, 4 jitter
      spotlight
      radius -90 falloff 90
      point_at -1000*z
      fade_power 2
      fade_distance sqrt(sX*sY)/N
      translate <sX*((C1+0.5)/N-0.5), sY*((C2+0.5)/N-0.5), 0> + cL
    }
  #declare C2 = C2 + 1; #end
#declare C1 = C1 + 1; #end


Post a reply to this message

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