Exemplo n.º 1
0
 vplIntegrator::vplIntegrator(const Parms& parms)
   : lightSampleID(-1), firstScatterSampleID(-1), firstScatterTypeSampleID(-1)
 {
   maxDepth        = parms.getInt  ("maxDepth"       ,10    );
   minContribution = parms.getFloat("minContribution",0.01f );
   epsilon         = parms.getFloat("epsilon"        ,32.0f)*float(ulp);
   backplate       = parms.getImage("backplate");
 }
 PathTraceIntegrator::PathTraceIntegrator(const Parms& parms)
   : lightSampleID(-1), firstScatterSampleID(-1), firstScatterTypeSampleID(-1), sampleLightForGlossy(false)
 {
   maxDepth        = parms.getInt  ("maxDepth"       ,10    );
   minContribution = parms.getFloat("minContribution",0.01f );
   epsilon         = parms.getFloat("epsilon"        ,32.0f)*float(ulp);
   backplate       = parms.getImage("backplate");
   sampleLightForGlossy = parms.getInt  ("sampleLightForGlossy",0);
 }
Exemplo n.º 3
0
  HDRILight::HDRILight(const Parms& parms)
    : width(0), height(0), pixels(null)
  {
    local2world = parms.getTransform("local2world",one);
    world2local = rcp(local2world);
    L = parms.getColor("L",one);
    pixels = parms.getImage("image");
    if (pixels == null) pixels = new Image3f(5,5,one);
    width  = (unsigned) pixels->width;
    height = (unsigned) pixels->height;

    Array2D<float> importance(height,width);
    for (size_t y = 0; y < height; y++)
      for (size_t x = 0; x < width; x++)
        importance.set(y, x, sinf(float(pi)*(y+0.5f)*rcp(float(height))) * reduce_add(pixels->get(x,y)));

    distribution = new Distribution2D(importance,width,height);
  }