Providing absorption spectra to Iray?

Is there a way to use absorption and scattering spectra for volumes in USD Composer for spectral rendering in Iray? I only see the option to define RGB values.

There is no dedicated ui for inputting spectra. We would not expect people to want to enter large numbers of values for wavelengths and coefficients manually in the ui. Most of the time we would expect the spectra to be in a ascii text file as result of a measurement.

An example would be standard illuminants like F11 CIE standard illuminants

I would store the values in an mdl file like this:

export const float[] F11_wavelengths = float[81](380.0,385.0,390.0,395.0,400.0,405.0,410.0,415.0,420.0,425.0,430.0,435.0,440.0,445.0,450.0,455.0,460.0,465.0,470.0,475.0,480.0,485.0,490.0,495.0,500.0,505.0,510.0,515.0,520.0,525.0,530.0,535.0,540.0,545.0,550.0,555.0,560.0,565.0,570.0,575.0,580.0,585.0,590.0,595.0,600.0,605.0,610.0,615.0,620.0,625.0,630.0,635.0,640.0,645.0,650.0,655.0,660.0,665.0,670.0,675.0,680.0,685.0,690.0,695.0,700.0,705.0,710.0,715.0,720.0,725.0,730.0,735.0,740.0,745.0,750.0,755.0,760.0,765.0,770.0,775.0,780.0);
export const float[] F11_values = float[81](0.91,0.63,0.46,0.37,1.29,12.68,1.59,1.79,2.46,3.33,4.49,33.94,12.13,6.95,7.19,7.12,6.72,6.13,5.46,4.79,5.66,14.29,14.96,8.97,4.72,2.33,1.47,1.1,0.89,0.83,1.18,4.9,39.59,72.84,32.61,7.52,2.83,1.96,1.67,4.43,11.28,14.76,12.73,9.74,7.33,9.72,55.27,42.58,13.18,13.16,12.26,5.11,2.07,2.34,3.58,3.01,2.48,2.14,1.54,1.33,1.46,1.94,2.0,1.2,1.35,4.1,5.58,2.51,0.57,0.27,0.23,0.21,0.24,0.24,0.2,0.24,0.32,0.26,0.16,0.12,0.09);

and then write a function to return the value

export uniform color getLightColorF11() {
   return math::emission_color(   F11_wavelengths,    F11_values);

this function could be used in the graph editor to set the light colors of mdl emissive materials to the desired sprectral emissivities.

Thanks a lot for the answer. I will try this.

Thanks, works perfectly fine.

Wonderful News !!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.