POV-Ray : Newsgroups : povray.binaries.images : IBL : Re: IBL Server Time
7 Aug 2024 15:20:56 EDT (-0400)
  Re: IBL  
From: Trevor G Quayle
Date: 19 Apr 2006 14:55:00
Message: <web.44468657f8d220636c4803960@news.povray.org>
Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:
> > Can you try averaging the images using a weighting appropriate to the
> >  reltive f-stops and camera response curve?
>
>    Very good suggestion, but I would have to learn *a lot* about
> photography to be able to do this... Now that I remember, my brother was
> into the photographic hobby some years ago and perhaps he still has some
> basic books around (I only have to find the time to read them... :)
>
> --
> Jaime

Here is my attempt at doing this (I assume I know what you are doing, i.e.
you are trying to assemble a series of LDR images into an HDR image within
POV).  The difficult part is determining a camera response curve (similar
to monitor gamma) and the relative/absolute F-Stop values for the given
images. I'm not even sure I've applied the response curve correctly here,
but it seems ok even though the results are slightly different than that
obtained using HDRShop.

//start

#declare CamRsp=2.2;//Camera response curve
#declare NumMaps=5;

#declare
Maps=array[NumMaps][2]{{"Chateau-4","-4"},{"Chateau-2","-2"},{"Chateau+0","0"},{"Chateau+2","2"},{"Chateau+4","4"}}//{i
mage,
absolute FStop value}

#local PIMAGE = function {
  pigment{onion
    pigment_map{
    #local i=0;#while (i<NumMaps)
      [i/NumMaps     image_map {jpeg Maps[i][0] interpolate 2 map_type 1}]
      [(i+1)/NumMaps image_map {jpeg Maps[i][0] interpolate 2 map_type 1}]
    #local i=i+1;#end
    }
    phase -0.5/NumMaps
    scale<1,1,-1>*NumMaps
  }
}

#local FRd=function(x,y,z) {max(
  #local i=1;#while (i<=NumMaps)
    #local FS=val(Maps[i-1][1]);

pow(PIMAGE(i*x/sqrt(x*x+y*y+z*z),i*y/sqrt(x*x+y*y+z*z),i*z/sqrt(x*x+y*y+z*z)).red,CamRsp)/pow(2,FS),
  #local i=i+1;#end
0)}
#local FGn=function(x,y,z) {max(
  #local i=1;#while (i<=NumMaps)
    #local FS=val(Maps[i-1][1]);

pow(PIMAGE(i*x/sqrt(x*x+y*y+z*z),i*y/sqrt(x*x+y*y+z*z),i*z/sqrt(x*x+y*y+z*z)).green,CamRsp)/pow(2,FS),
  #local i=i+1;#end
0)}
#local FBl=function(x,y,z) {max(
  #local i=1;#while (i<=NumMaps)
    #local FS=val(Maps[i-1][1]);

pow(PIMAGE(i*x/sqrt(x*x+y*y+z*z),i*y/sqrt(x*x+y*y+z*z),i*z/sqrt(x*x+y*y+z*z)).blue,CamRsp)/pow(2,FS),
  #local i=i+1;#end
0)}


#declare Stops=0;

#declare Tex1=
  texture{
    pigment{average
      pigment_map{
          [function{FRd(x,y,z)/10000} color_map{[0 rgb 0][1 rgb <1,0,0>]}]
          [function{FGn(x,y,z)/10000} color_map{[0 rgb 0][1 rgb <0,1,0>]}]
          [function{FBl(x,y,z)/10000} color_map{[0 rgb 0][1 rgb <0,0,1>]}]
      }
    }
    finish {ambient 3*pow(2,Stops)*10000 diffuse 0}
  }

//

-tgq


Post a reply to this message

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