[Radiance-general] specifying sources

william reynolds william.reynolds at oriel.ox.ac.uk
Mon Mar 27 21:35:30 CEST 2006


greg - forgive me if im being a bit slow with this, but i've a few more 
questions!

so i think i understand the conversion to sharp RGB now. though i was 
under the impression that the sharp RGB colour space used the D65 white 
point, not the equal energy 1/3, 1/3 point (which is D50 i think?). 
guess i was wrong!

where i'm getting stuck is with specifying the sources.

1. using blackbody.cal:
-should i use this to calculate the emitted power for a selection of 
lambda values (presumeably using a separate script to input the lamda 
values)? if so, how do i then go about converting the results into XYZ 
values, so that i can then convert to the sharp rgb colour space? 
(presumably illumcal.csh uses the power vs. lamda data and CIE standard 
observers, but i dont follow how to use it! also, does it produce RGB or 
XYZ values?)
-or should i use it to calculate the cromaticity (x,y) coordinates? if 
so, can i  then simply use rgb.cal (if this is what its equations do!) 
to convert the (x,y) cromaticity results to RGB values, ignoring the Y, 
"brightness", value?
-currently (ie before i apply any colour filters) my sources are simply 
white, i have ignored their colour temperature. when i applied the 
colour filteers i was going to use the XYZ data given for a 3200K 
source, rather than that measured with the C source. i was hoping that 
this would mean i do not have to add the effect of the colour of the 
source as well, is that correct? if not, then how do i model both the 
effect of the lamps colour temperature and the colour filter in my scene 
file, while maintaining the correct physical light output of the 
fixture? do i simply multiply the 3 (corrected intensity) output values 
by the colour temperature values, and then again by the colour filter 
values? and should i just worry about the R:G:B ratio for each of these, 
  or do i need to multiply by the actual, calculated values?
would it be better to use several primitives (ie one for the colour 
temperature, one for the colour filter) to modify the colour of the 
source, rather than doing lots of multiplications before hand?

2.using neutral light sources
-i think i understand the principles of what you said in your paper, but 
i dont really follow how to implement this!
my scene has only one source in it, so this is what i understand i 
should do:
once i have calculated the sharp RGB values of the output of my source i 
should divide every material colour by the source colour (individually 
for r, g, b) and replace the source with a white one. should this white 
source be normalised to a value of 1 1 1, and the intensity of the 
source be taken into account in the premultiplication above, or should 
the intensity of the source left out of these premultiplications?
how do i then regain the colour information after the rendering? is it 
as simple as postmultiplying every pixel in the pixel by the inverse of 
the appropriate r, g or b value used in the pre-multiplication?

thanks again, and sorry for the barrage of questions!
will




Gregory J. Ward wrote:
> Hi Will,
> 
>> converting to sharp RGB:
>> -i think i can just change some constants in the xyz_rgb.cal file,  
>> (values for sharp RGB are given in Sharp.cal) to change the clour  space.
> 
> 
> You can actually run the same command, inserting -f Sharp.cal after - f 
> xyz_rgb.cal (putting it before would do nothing).
> 
>> -i assume that all colours (ie of materials as well as sources)  have 
>> to be converted?
> 
> 
> Yes, in fact to get the full benefit of the method, you should start  
> with spectral data and premultiply the spectral power and reflectance  
> of each surface material if it's available.
> 
>> -the rendered picture will then be in th sharp RGB colour space,  
>> which ximage does not use, so every pixel in the image then has to  be 
>> converted to back to the radiance RGB primaries. is this right?  if 
>> so, is there a utility to apply the transformation to a .pic  file or 
>> do i need to write a script?
> 
> 
> Here is one of the missing bits in the process.  Radiance doesn't  care 
> what color space it renders in, but the default of downstream  picture 
> tools is to use the standard primaries defined in color.h if  none are 
> specified in the picture file.  Therefore, it is best if you  specify 
> the correct color primaries following your rendering using a  script 
> like so:
> 
> #!/bin/csh -f
> # Add Sharp color primaries to Radiance picture header
> foreach f ($*)
>     getinfo < $f > tf$$
>     ed - tf$$ << '_EOF_'
> /^PRIMARIES=/d
> /^FORMAT=/i
> PRIMARIES= .6898 .3206 .0736 .9003 .1166 .0374 .3333 .3333
> .
> w
> q
> '_EOF_'
>     getinfo - < $f >> tf$$
>     mv tf$$ $f
> end
> 
> You can accomplish the same thing manually using the "vinfo" script  
> that comes with Radiance, but the above lets you convert a set of  
> pictures more quickly and conveniently.  I would call it addSharp or  
> something like that.
> 
> Once your Radiance picture has the right primaries installed in its  
> header, some but not all of the Radiance tools will know what to do  
> with them.  To convert the image back to the standard Radiance color  
> space, you can use:
> 
>     ra_xyze -r sharp.pic standard.pic
> 
> Obviously, this would also work with an XYZE input picture.  The  
> converters pcond, ra_bmp, and ra_tiff also understand the PRIMARIES=  
> header line, as does Photosphere, which will display the images  
> correctly without preconversion.
> 
>> white point adjustment:
>> -presumably the white point that radiance uses is the same as most  
>> monitors (D65 i think) so i need to transform from the white point  of 
>> the XYZ colour space to that of the sharp RGB (or radiance RGB)  
>> colour space, but only because of this change in colour space.
> 
> 
> Radiance uses an equal-energy white (x,y)=(1/3,1/3) by default, and  
> this is the default for the Sharp color space and XYZ as well, so no  
> need to convert the white point for Radiance.
> 
>> -can anyone start me off with how to apply the white point  
>> transformation? i assume it uses the vonKries.cal file, and that  the 
>> inputs (initial and final white point cramaticities) are  standard 
>> values for the colour spaces in question, but how is it  used!?
> 
> 
> Thankfully, ra_xyze and the other tools do a vonKries-style white  point 
> conversion for you, so you needn't worry about this bit.
> 
>> -the XYZ data (and the xy coordinates) i have are given for both a  C 
>> source (the CIE standard?) and for a tungsten lamp with colout  temp 
>> 3200K, so i presume i should use the tungsten readings (as my  lamps 
>> are tungsten).
> 
> 
> Yes, indeed.
> 
>> -the sources i am modelling are tungsten, but i want an accurate  
>> representation of what the colour will look like, so presumably i  
>> need some sort of white point transformatin to correct their slight  
>> orangeness, as the eye is quite good at correcting this, i believe.  
>> how should i specify this? i know the lamps' colour temperature  
>> (about 3200K).
> 
> 
> The CIE (x,y) chromaticity for a 3200K black body is  (0.4234,0.3990).  
> You can use the formula in blackbody.cal to convert  color temperature 
> to spectral power, and then the CIE standard  observers to get to XYZ.
> 
>> and finally, how should i apply the colour to my sources?
> 
> 
> You can premultiply the illuminant and reflectance values (using  Sharp 
> RGB) and put neutral light sources for your dominant source  (tungsten 
> 3200K).  This is spelled out towards the end of section 2  in the EGWR 
> paper.
> 
>> -i have XYZ tristimulus and xy cromaticity coordinate data for the  
>> filters i want to use, but i'm not sure of the best way to apply it.
>> (data comes from eg.  http://www.leefilters.com/LPFD.asp?PageID=248  )
> 
> 
> Convert to Sharp RGB and multiply this value if you don't have  spectral 
> data.  If you have spectral data for the filters, you are  better off 
> using that.  (I see they have a plot on their website, so  maybe they'll 
> give you data as well.)
> 
>> -i could either the calculated RGB values to scale the output from  my 
>> source primative (though would i have to take the Y value  
>> (reflectance/transmission depending on the context i believe) into  
>> account, or is this done automatically in the conversion?). This is  
>> what i did for my first test run earlier (converting XYZ values to  
>> radiance RGB primaries, and then not using the Y value again), and  
>> the result seemed to bright for the filter i was using (i had 2  
>> sources in the scene, one coloured, the other not, and they were  both 
>> of similar brigtness).
> 
> 
> Luminance should pass through the conversion with minimal changes,  but 
> this is only really guaranteed if you use properly normalized  spectra 
> rather than RGB multiplication.
> 
>> -or i could use the RGB values to define the transmission of a thin  
>> piece of glass, and place this in front of the source (as a real  
>> filter is).
> 
> 
> The net result would be (nearly) the same, but the glass would be  more 
> expensive to compute.
> 
> -Greg
> 
> _______________________________________________
> Radiance-general mailing list
> Radiance-general at radiance-online.org
> http://www.radiance-online.org/mailman/listinfo/radiance-general
> 
> 



More information about the Radiance-general mailing list